From 683308da54f5c2d7c7b119dd8536535faff10d98 Mon Sep 17 00:00:00 2001 From: jasquat Date: Wed, 1 Mar 2023 15:40:17 -0500 Subject: [PATCH] removed old branch migrations and created single one for this branch w/ burnettk --- .../migrations/versions/553ba18e4076_.py | 50 ------------------- .../{dc8f4b664e78_.py => 7422be14adc4_.py} | 31 ++++++++---- .../migrations/versions/e494a3955ce5_.py | 32 ------------ .../migrations/versions/fdf522e4c48a_.py | 33 ------------ 4 files changed, 20 insertions(+), 126 deletions(-) delete mode 100644 spiffworkflow-backend/migrations/versions/553ba18e4076_.py rename spiffworkflow-backend/migrations/versions/{dc8f4b664e78_.py => 7422be14adc4_.py} (56%) delete mode 100644 spiffworkflow-backend/migrations/versions/e494a3955ce5_.py delete mode 100644 spiffworkflow-backend/migrations/versions/fdf522e4c48a_.py diff --git a/spiffworkflow-backend/migrations/versions/553ba18e4076_.py b/spiffworkflow-backend/migrations/versions/553ba18e4076_.py deleted file mode 100644 index 2f7b736a..00000000 --- a/spiffworkflow-backend/migrations/versions/553ba18e4076_.py +++ /dev/null @@ -1,50 +0,0 @@ -"""empty message - -Revision ID: 553ba18e4076 -Revises: e494a3955ce5 -Create Date: 2023-03-01 11:31:20.619328 - -""" -from alembic import op -import sqlalchemy as sa -from sqlalchemy.dialects import mysql - -# revision identifiers, used by Alembic. -revision = '553ba18e4076' -down_revision = 'e494a3955ce5' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('process_instance', sa.Column('process_instance_data_id', sa.Integer(), nullable=True)) - op.create_foreign_key(None, 'process_instance', 'process_instance_data', ['process_instance_data_id'], ['id']) - op.alter_column('process_instance_data', 'runtime_json', - existing_type=mysql.JSON(), - nullable=False) - op.drop_constraint('process_instance_data_ibfk_1', 'process_instance_data', type_='foreignkey') - op.drop_column('process_instance_data', 'process_instance_id') - op.alter_column('serialized_bpmn_definition', 'static_json', - existing_type=mysql.JSON(), - nullable=False) - op.drop_index('ix_serialized_bpmn_definition_hash', table_name='serialized_bpmn_definition') - op.create_index(op.f('ix_serialized_bpmn_definition_hash'), 'serialized_bpmn_definition', ['hash'], unique=True) - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.drop_index(op.f('ix_serialized_bpmn_definition_hash'), table_name='serialized_bpmn_definition') - op.create_index('ix_serialized_bpmn_definition_hash', 'serialized_bpmn_definition', ['hash'], unique=False) - op.alter_column('serialized_bpmn_definition', 'static_json', - existing_type=mysql.JSON(), - nullable=True) - op.add_column('process_instance_data', sa.Column('process_instance_id', mysql.INTEGER(), autoincrement=False, nullable=False)) - op.create_foreign_key('process_instance_data_ibfk_1', 'process_instance_data', 'process_instance', ['process_instance_id'], ['id']) - op.alter_column('process_instance_data', 'runtime_json', - existing_type=mysql.JSON(), - nullable=True) - op.drop_constraint(None, 'process_instance', type_='foreignkey') - op.drop_column('process_instance', 'process_instance_data_id') - # ### end Alembic commands ### diff --git a/spiffworkflow-backend/migrations/versions/dc8f4b664e78_.py b/spiffworkflow-backend/migrations/versions/7422be14adc4_.py similarity index 56% rename from spiffworkflow-backend/migrations/versions/dc8f4b664e78_.py rename to spiffworkflow-backend/migrations/versions/7422be14adc4_.py index bdb69266..810696ed 100644 --- a/spiffworkflow-backend/migrations/versions/dc8f4b664e78_.py +++ b/spiffworkflow-backend/migrations/versions/7422be14adc4_.py @@ -1,8 +1,8 @@ """empty message -Revision ID: dc8f4b664e78 -Revises: fdf522e4c48a -Create Date: 2023-02-28 17:38:42.496187 +Revision ID: 7422be14adc4 +Revises: ac6b60d7fee9 +Create Date: 2023-03-01 15:39:25.731722 """ from alembic import op @@ -10,8 +10,8 @@ import sqlalchemy as sa # revision identifiers, used by Alembic. -revision = 'dc8f4b664e78' -down_revision = 'fdf522e4c48a' +revision = '7422be14adc4' +down_revision = 'ac6b60d7fee9' branch_labels = None depends_on = None @@ -20,23 +20,32 @@ def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('process_instance_data', sa.Column('id', sa.Integer(), nullable=False), - sa.Column('process_instance_id', sa.Integer(), nullable=False), - sa.Column('runtime_json', sa.JSON(), nullable=True), - sa.ForeignKeyConstraint(['process_instance_id'], ['process_instance.id'], ), + sa.Column('runtime_json', sa.JSON(), nullable=False), sa.PrimaryKeyConstraint('id') ) + op.create_table('serialized_bpmn_definition', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('hash', sa.String(length=255), nullable=False), + sa.Column('static_json', sa.JSON(), nullable=False), + sa.PrimaryKeyConstraint('id') + ) + op.create_index(op.f('ix_serialized_bpmn_definition_hash'), 'serialized_bpmn_definition', ['hash'], unique=True) op.add_column('process_instance', sa.Column('serialized_bpmn_definition_id', sa.Integer(), nullable=True)) + op.add_column('process_instance', sa.Column('process_instance_data_id', sa.Integer(), nullable=True)) + op.create_foreign_key(None, 'process_instance', 'process_instance_data', ['process_instance_data_id'], ['id']) op.create_foreign_key(None, 'process_instance', 'serialized_bpmn_definition', ['serialized_bpmn_definition_id'], ['id']) - op.create_index(op.f('ix_serialized_bpmn_definition_hash'), 'serialized_bpmn_definition', ['hash'], unique=False) - op.add_column('spiff_step_details', sa.Column('delta_json', sa.JSON(), nullable=False)) + op.add_column('spiff_step_details', sa.Column('delta_json', sa.JSON(), nullable=True)) # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_column('spiff_step_details', 'delta_json') - op.drop_index(op.f('ix_serialized_bpmn_definition_hash'), table_name='serialized_bpmn_definition') op.drop_constraint(None, 'process_instance', type_='foreignkey') + op.drop_constraint(None, 'process_instance', type_='foreignkey') + op.drop_column('process_instance', 'process_instance_data_id') op.drop_column('process_instance', 'serialized_bpmn_definition_id') + op.drop_index(op.f('ix_serialized_bpmn_definition_hash'), table_name='serialized_bpmn_definition') + op.drop_table('serialized_bpmn_definition') op.drop_table('process_instance_data') # ### end Alembic commands ### diff --git a/spiffworkflow-backend/migrations/versions/e494a3955ce5_.py b/spiffworkflow-backend/migrations/versions/e494a3955ce5_.py deleted file mode 100644 index 0a8b592b..00000000 --- a/spiffworkflow-backend/migrations/versions/e494a3955ce5_.py +++ /dev/null @@ -1,32 +0,0 @@ -"""empty message - -Revision ID: e494a3955ce5 -Revises: dc8f4b664e78 -Create Date: 2023-02-28 17:41:51.208350 - -""" -from alembic import op -import sqlalchemy as sa -from sqlalchemy.dialects import mysql - -# revision identifiers, used by Alembic. -revision = 'e494a3955ce5' -down_revision = 'dc8f4b664e78' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.alter_column('spiff_step_details', 'delta_json', - existing_type=mysql.JSON(), - nullable=True) - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.alter_column('spiff_step_details', 'delta_json', - existing_type=mysql.JSON(), - nullable=False) - # ### end Alembic commands ### diff --git a/spiffworkflow-backend/migrations/versions/fdf522e4c48a_.py b/spiffworkflow-backend/migrations/versions/fdf522e4c48a_.py deleted file mode 100644 index 051710fa..00000000 --- a/spiffworkflow-backend/migrations/versions/fdf522e4c48a_.py +++ /dev/null @@ -1,33 +0,0 @@ -"""empty message - -Revision ID: fdf522e4c48a -Revises: ac6b60d7fee9 -Create Date: 2023-02-28 14:50:26.030983 - -""" -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision = 'fdf522e4c48a' -down_revision = 'ac6b60d7fee9' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.create_table('serialized_bpmn_definition', - sa.Column('id', sa.Integer(), nullable=False), - sa.Column('hash', sa.String(length=255), nullable=False), - sa.Column('static_json', sa.JSON(), nullable=True), - sa.PrimaryKeyConstraint('id') - ) - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.drop_table('serialized_bpmn_definition') - # ### end Alembic commands ###