summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Thiemonge <gthiemon@redhat.com>2021-04-27 16:53:20 +0200
committerGregory Thiemonge <gthiemon@redhat.com>2021-05-03 10:16:10 +0200
commitebdb7a85d0cbd84578e9b48f7ac4c2dea94a3798 (patch)
treedee3f8168313f00ee122009001e7ddf3f55e4853
parentf6c7664bad963981413c66ecd15afdb8d62341be (diff)
downloadtaskflow-ebdb7a85d0cbd84578e9b48f7ac4c2dea94a3798.tar.gz
Fix flowdetails meta size
meta field in flowdetails is defined as a JSON data type, but its data type is 'text' in mysql, which is limited to 64kbytes. JSON data type should have the same size as a LONGTEXT. Closes-Bug: #1926304 Change-Id: I9f89badfc697f0f26245ca7f4c22d62e220be5f9
-rw-r--r--taskflow/persistence/backends/sqlalchemy/alembic/versions/6df9422fcb43_fix_flowdetails_meta_size.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/taskflow/persistence/backends/sqlalchemy/alembic/versions/6df9422fcb43_fix_flowdetails_meta_size.py b/taskflow/persistence/backends/sqlalchemy/alembic/versions/6df9422fcb43_fix_flowdetails_meta_size.py
new file mode 100644
index 0000000..4adb945
--- /dev/null
+++ b/taskflow/persistence/backends/sqlalchemy/alembic/versions/6df9422fcb43_fix_flowdetails_meta_size.py
@@ -0,0 +1,34 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+"""fix flowdetails meta size
+
+Revision ID: 6df9422fcb43
+Revises: 0bc3e1a3c135
+Create Date: 2021-04-27 14:51:53.618249
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '6df9422fcb43'
+down_revision = '0bc3e1a3c135'
+
+from alembic import op
+from sqlalchemy.dialects import mysql
+
+
+def upgrade():
+ bind = op.get_bind()
+ engine = bind.engine
+ if engine.name == 'mysql':
+ op.alter_column('flowdetails', 'meta', type_=mysql.LONGTEXT,
+ existing_nullable=True)