From 6fb78f356139dec2ba401521f971d40c8d542574 Mon Sep 17 00:00:00 2001 From: Rajat Jain Date: Tue, 19 Apr 2022 14:52:13 +0530 Subject: [PATCH] Update type of 'description' field to 'text' for table workflow_executions_v2 Change-Id: I5ae7f0f39822c99d11bd7cd6191e036afd7e6721 --- ...n_field_type_for_workflow_executions_v2.py | 38 +++++++++++++++++++ ...rkflow-executions-v2-e3a2782a0ee58ebe.yaml | 5 +++ 2 files changed, 43 insertions(+) create mode 100644 mistral/db/sqlalchemy/migration/alembic_migrations/versions/041_update_description_field_type_for_workflow_executions_v2.py create mode 100644 releasenotes/notes/update-type-of-description-field-for-workflow-executions-v2-e3a2782a0ee58ebe.yaml diff --git a/mistral/db/sqlalchemy/migration/alembic_migrations/versions/041_update_description_field_type_for_workflow_executions_v2.py b/mistral/db/sqlalchemy/migration/alembic_migrations/versions/041_update_description_field_type_for_workflow_executions_v2.py new file mode 100644 index 000000000..b7203070c --- /dev/null +++ b/mistral/db/sqlalchemy/migration/alembic_migrations/versions/041_update_description_field_type_for_workflow_executions_v2.py @@ -0,0 +1,38 @@ +# Copyright 2020 Nokia Software. +# +# 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. + +"""Update type of 'description' field for + table 'workflow_executions_v2' to text + +Revision ID: 041 +Revises: 040 +Create Date: 2022-04-19 + +""" + +# revision identifiers, used by Alembic. +revision = '041' +down_revision = '040' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + op.alter_column( + 'workflow_executions_v2', + column_name='description', type_=sa.Text(), + existing_type=sa.String(length=255) + ) diff --git a/releasenotes/notes/update-type-of-description-field-for-workflow-executions-v2-e3a2782a0ee58ebe.yaml b/releasenotes/notes/update-type-of-description-field-for-workflow-executions-v2-e3a2782a0ee58ebe.yaml new file mode 100644 index 000000000..cdbc58c58 --- /dev/null +++ b/releasenotes/notes/update-type-of-description-field-for-workflow-executions-v2-e3a2782a0ee58ebe.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + The dbsync needs to be executed to run the migration of the + description field in the workflow_executions_v2 table to text. \ No newline at end of file