summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnn Taraday <akamyshnikova@mirantis.com>2019-08-08 16:56:04 +0400
committerAnn Taraday <akamyshnikova@mirantis.com>2019-08-09 07:18:31 +0000
commitf0eae2cc7c1222ee1bbc1a0018337fb2a2289de2 (patch)
tree9b9772dc163f558f98882ad8f6203d3f5eccb55f
parente077956819c327f79dcb378c3f638c94a8020fb2 (diff)
downloadtaskflow-3.7.1.tar.gz
Use mysql LONGTEXT for atomdetails resultstrain-em3.7.1
With a lot of possible retries using mysql sa.Text for result field atomdetails table is not enough. Updated 'results' column type to LONGTEXT in mysql backend case. PosgreSQL seems not to be affected as postgres text type is not having length limitation. Co-Authored-By: Michael Johnson <johnsomor@gmail.com> Change-Id: I4e44e3288ae49d85c5b5ce8ff26ba83f3b9d2c7b Closes-bug: #1838015
-rw-r--r--taskflow/persistence/backends/sqlalchemy/alembic/versions/0bc3e1a3c135_set_result_meduimtext_type.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/taskflow/persistence/backends/sqlalchemy/alembic/versions/0bc3e1a3c135_set_result_meduimtext_type.py b/taskflow/persistence/backends/sqlalchemy/alembic/versions/0bc3e1a3c135_set_result_meduimtext_type.py
new file mode 100644
index 0000000..d1a5e68
--- /dev/null
+++ b/taskflow/persistence/backends/sqlalchemy/alembic/versions/0bc3e1a3c135_set_result_meduimtext_type.py
@@ -0,0 +1,43 @@
+# 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.
+
+"""set_result_meduimtext_type
+
+Revision ID: 0bc3e1a3c135
+Revises: 2ad4984f2864
+Create Date: 2019-08-08 16:11:36.221164
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '0bc3e1a3c135'
+down_revision = '2ad4984f2864'
+
+from alembic import op
+import sqlalchemy as sa
+from sqlalchemy.dialects import mysql
+
+
+def upgrade():
+ bind = op.get_bind()
+ engine = bind.engine
+ if engine.name == 'mysql':
+ op.alter_column('atomdetails', 'results', type_=mysql.LONGTEXT,
+ existing_nullable=True)
+
+
+def downgrade():
+ bind = op.get_bind()
+ engine = bind.engine
+ if engine.name == 'mysql':
+ op.alter_column('atomdetails', 'results', type_=sa.Text(),
+ existing_nullable=True)