diff --git a/spiffworkflow-backend/migrations/env.py b/spiffworkflow-backend/migrations/env.py index 630e381a..68feded2 100644 --- a/spiffworkflow-backend/migrations/env.py +++ b/spiffworkflow-backend/migrations/env.py @@ -1,3 +1,5 @@ +from __future__ import with_statement + import logging from logging.config import fileConfig diff --git a/spiffworkflow-backend/migrations/versions/63fc8d693b9f_.py b/spiffworkflow-backend/migrations/versions/63fc8d693b9f_.py deleted file mode 100644 index e723474c..00000000 --- a/spiffworkflow-backend/migrations/versions/63fc8d693b9f_.py +++ /dev/null @@ -1,34 +0,0 @@ -"""empty message - -Revision ID: 63fc8d693b9f -Revises: e05ca5cdc312 -Create Date: 2023-02-09 11:54:34.935801 - -""" -from alembic import op -import sqlalchemy as sa -from sqlalchemy.dialects import mysql - -# revision identifiers, used by Alembic. -revision = '63fc8d693b9f' -down_revision = 'e05ca5cdc312' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('spiff_step_details', sa.Column('start_in_seconds', sa.DECIMAL(precision=17, scale=6), nullable=False)) - op.add_column('spiff_step_details', sa.Column('end_in_seconds', sa.DECIMAL(precision=17, scale=6), nullable=True)) - op.drop_column('spiff_step_details', 'engine_step_end_in_seconds') - op.drop_column('spiff_step_details', 'engine_step_start_in_seconds') - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('spiff_step_details', sa.Column('engine_step_start_in_seconds', mysql.DECIMAL(precision=17, scale=6), nullable=True)) - op.add_column('spiff_step_details', sa.Column('engine_step_end_in_seconds', mysql.DECIMAL(precision=17, scale=6), nullable=True)) - op.drop_column('spiff_step_details', 'end_in_seconds') - op.drop_column('spiff_step_details', 'start_in_seconds') - # ### end Alembic commands ### diff --git a/spiffworkflow-backend/migrations/versions/9f0b1662a8af_.py b/spiffworkflow-backend/migrations/versions/9f0b1662a8af_.py deleted file mode 100644 index 6f3270f3..00000000 --- a/spiffworkflow-backend/migrations/versions/9f0b1662a8af_.py +++ /dev/null @@ -1,153 +0,0 @@ -"""empty message - -Revision ID: 9f0b1662a8af -Revises: 63fc8d693b9f -Create Date: 2023-02-24 14:30:05.970959 - -""" -from alembic import op -import sqlalchemy as sa -from sqlalchemy.dialects import mysql - -# revision identifiers, used by Alembic. -revision = '9f0b1662a8af' -down_revision = '63fc8d693b9f' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.create_table('correlation_property_cache', - sa.Column('id', sa.Integer(), nullable=False), - sa.Column('name', sa.String(length=50), nullable=False), - sa.Column('message_name', sa.String(length=50), nullable=False), - sa.Column('process_model_id', sa.String(length=255), nullable=False), - sa.Column('retrieval_expression', sa.String(length=255), nullable=True), - sa.PrimaryKeyConstraint('id') - ) - op.create_table('message_instance_correlation_rule', - sa.Column('id', sa.Integer(), nullable=False), - sa.Column('message_instance_id', sa.Integer(), nullable=False), - sa.Column('name', sa.String(length=50), nullable=False), - sa.Column('retrieval_expression', sa.String(length=255), nullable=True), - sa.Column('updated_at_in_seconds', sa.Integer(), nullable=True), - sa.Column('created_at_in_seconds', sa.Integer(), nullable=True), - sa.ForeignKeyConstraint(['message_instance_id'], ['message_instance.id'], ), - sa.PrimaryKeyConstraint('id'), - sa.UniqueConstraint('message_instance_id', 'name', name='message_instance_id_name_unique') - ) - op.create_index(op.f('ix_message_instance_correlation_rule_message_instance_id'), 'message_instance_correlation_rule', ['message_instance_id'], unique=False) - op.drop_index('ix_message_model_identifier', table_name='message_model') - op.drop_index('ix_message_model_name', table_name='message_model') - op.drop_constraint('message_correlation_property_ibfk_1', 'message_correlation_property', type_='foreignkey') - op.drop_constraint('message_triggerable_process_model_ibfk_1', 'message_triggerable_process_model', type_='foreignkey') - op.drop_constraint('message_instance_ibfk_1', 'message_instance', type_='foreignkey') - op.drop_table('message_model') - op.drop_constraint('message_correlation_message_instance_ibfk_1', 'message_correlation_message_instance', type_='foreignkey') - op.drop_index('ix_message_correlation_name', table_name='message_correlation') - op.drop_index('ix_message_correlation_process_instance_id', table_name='message_correlation') - op.drop_index('ix_message_correlation_value', table_name='message_correlation') -# op.drop_index('message_instance_id_name_unique', table_name='message_correlation') -# op.drop_index('ix_message_correlation_message_correlation_property_id', table_name='message_correlation') - op.drop_table('message_correlation') - op.drop_index('ix_message_correlation_message_instance_message_correlation_id', table_name='message_correlation_message_instance') - op.drop_index('ix_message_correlation_message_instance_message_instance_id', table_name='message_correlation_message_instance') -# op.drop_index('message_correlation_message_instance_unique', table_name='message_correlation_message_instance') - op.drop_table('message_correlation_message_instance') - op.drop_index('ix_message_correlation_property_identifier', table_name='message_correlation_property') - op.drop_index('message_correlation_property_unique', table_name='message_correlation_property') - op.drop_table('message_correlation_property') - op.add_column('message_instance', sa.Column('name', sa.String(length=255), nullable=True)) - op.add_column('message_instance', sa.Column('correlation_keys', sa.JSON(), nullable=True)) - op.add_column('message_instance', sa.Column('user_id', sa.Integer(), nullable=False)) - op.add_column('message_instance', sa.Column('counterpart_id', sa.Integer(), nullable=True)) - op.alter_column('message_instance', 'process_instance_id', - existing_type=mysql.INTEGER(), - nullable=True) - op.create_foreign_key(None, 'message_instance', 'user', ['user_id'], ['id']) - op.drop_column('message_instance', 'message_model_id') - op.add_column('message_triggerable_process_model', sa.Column('message_name', sa.String(length=255), nullable=True)) - op.drop_index('message_model_id', table_name='message_triggerable_process_model') - op.drop_column('message_triggerable_process_model', 'message_model_id') - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('message_triggerable_process_model', sa.Column('message_model_id', mysql.INTEGER(), autoincrement=False, nullable=False)) - op.create_index('message_model_id', 'message_triggerable_process_model', ['message_model_id'], unique=False) - op.drop_column('message_triggerable_process_model', 'message_name') - op.add_column('message_instance', sa.Column('message_model_id', mysql.INTEGER(), autoincrement=False, nullable=False)) - op.drop_constraint(None, 'message_instance', type_='foreignkey') - op.create_foreign_key('message_instance_ibfk_1', 'message_instance', 'message_model', ['message_model_id'], ['id']) - op.alter_column('message_instance', 'process_instance_id', - existing_type=mysql.INTEGER(), - nullable=False) - op.drop_column('message_instance', 'counterpart_id') - op.drop_column('message_instance', 'user_id') - op.drop_column('message_instance', 'correlation_keys') - op.drop_column('message_instance', 'name') - op.create_table('message_correlation_property', - sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False), - sa.Column('identifier', mysql.VARCHAR(length=50), nullable=True), - sa.Column('message_model_id', mysql.INTEGER(), autoincrement=False, nullable=False), - sa.Column('updated_at_in_seconds', mysql.INTEGER(), autoincrement=False, nullable=True), - sa.Column('created_at_in_seconds', mysql.INTEGER(), autoincrement=False, nullable=True), - sa.ForeignKeyConstraint(['message_model_id'], ['message_model.id'], name='message_correlation_property_ibfk_1'), - sa.PrimaryKeyConstraint('id'), - mysql_collate='utf8mb4_0900_ai_ci', - mysql_default_charset='utf8mb4', - mysql_engine='InnoDB' - ) - op.create_index('message_correlation_property_unique', 'message_correlation_property', ['identifier', 'message_model_id'], unique=False) - op.create_index('ix_message_correlation_property_identifier', 'message_correlation_property', ['identifier'], unique=False) - op.create_table('message_correlation_message_instance', - sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False), - sa.Column('message_instance_id', mysql.INTEGER(), autoincrement=False, nullable=False), - sa.Column('message_correlation_id', mysql.INTEGER(), autoincrement=False, nullable=False), - sa.ForeignKeyConstraint(['message_correlation_id'], ['message_correlation.id'], name='message_correlation_message_instance_ibfk_1'), - sa.ForeignKeyConstraint(['message_instance_id'], ['message_instance.id'], name='message_correlation_message_instance_ibfk_2'), - sa.PrimaryKeyConstraint('id'), - mysql_collate='utf8mb4_0900_ai_ci', - mysql_default_charset='utf8mb4', - mysql_engine='InnoDB' - ) - op.create_index('message_correlation_message_instance_unique', 'message_correlation_message_instance', ['message_instance_id', 'message_correlation_id'], unique=False) - op.create_index('ix_message_correlation_message_instance_message_instance_id', 'message_correlation_message_instance', ['message_instance_id'], unique=False) - op.create_index('ix_message_correlation_message_instance_message_correlation_id', 'message_correlation_message_instance', ['message_correlation_id'], unique=False) - op.create_table('message_correlation', - sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False), - sa.Column('process_instance_id', mysql.INTEGER(), autoincrement=False, nullable=False), - sa.Column('message_correlation_property_id', mysql.INTEGER(), autoincrement=False, nullable=False), - sa.Column('name', mysql.VARCHAR(length=255), nullable=False), - sa.Column('value', mysql.VARCHAR(length=255), nullable=False), - sa.Column('updated_at_in_seconds', mysql.INTEGER(), autoincrement=False, nullable=True), - sa.Column('created_at_in_seconds', mysql.INTEGER(), autoincrement=False, nullable=True), - sa.ForeignKeyConstraint(['message_correlation_property_id'], ['message_correlation_property.id'], name='message_correlation_ibfk_1'), - sa.ForeignKeyConstraint(['process_instance_id'], ['process_instance.id'], name='message_correlation_ibfk_2'), - sa.PrimaryKeyConstraint('id'), - mysql_collate='utf8mb4_0900_ai_ci', - mysql_default_charset='utf8mb4', - mysql_engine='InnoDB' - ) - op.create_index('message_instance_id_name_unique', 'message_correlation', ['process_instance_id', 'message_correlation_property_id', 'name'], unique=False) - op.create_index('ix_message_correlation_value', 'message_correlation', ['value'], unique=False) - op.create_index('ix_message_correlation_process_instance_id', 'message_correlation', ['process_instance_id'], unique=False) - op.create_index('ix_message_correlation_name', 'message_correlation', ['name'], unique=False) - op.create_index('ix_message_correlation_message_correlation_property_id', 'message_correlation', ['message_correlation_property_id'], unique=False) - op.create_table('message_model', - sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False), - sa.Column('identifier', mysql.VARCHAR(length=50), nullable=True), - sa.Column('name', mysql.VARCHAR(length=50), nullable=True), - sa.PrimaryKeyConstraint('id'), - mysql_collate='utf8mb4_0900_ai_ci', - mysql_default_charset='utf8mb4', - mysql_engine='InnoDB' - ) - op.create_index('ix_message_model_name', 'message_model', ['name'], unique=False) - op.create_index('ix_message_model_identifier', 'message_model', ['identifier'], unique=False) - op.drop_index(op.f('ix_message_instance_correlation_rule_message_instance_id'), table_name='message_instance_correlation_rule') - op.drop_table('message_instance_correlation_rule') - op.drop_table('correlation_property_cache') - # ### end Alembic commands ### diff --git a/spiffworkflow-backend/migrations/versions/ca9b79dde5cc_.py b/spiffworkflow-backend/migrations/versions/ca9b79dde5cc_.py deleted file mode 100644 index 8a7134f4..00000000 --- a/spiffworkflow-backend/migrations/versions/ca9b79dde5cc_.py +++ /dev/null @@ -1,32 +0,0 @@ -"""empty message - -Revision ID: ca9b79dde5cc -Revises: 2ec4222f0012 -Create Date: 2023-02-03 21:06:56.396816 - -""" -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision = 'ca9b79dde5cc' -down_revision = '2ec4222f0012' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('user', sa.Column('tenant_specific_field_1', sa.String(length=255), nullable=True)) - op.add_column('user', sa.Column('tenant_specific_field_2', sa.String(length=255), nullable=True)) - op.add_column('user', sa.Column('tenant_specific_field_3', sa.String(length=255), nullable=True)) - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.drop_column('user', 'tenant_specific_field_3') - op.drop_column('user', 'tenant_specific_field_2') - op.drop_column('user', 'tenant_specific_field_1') - # ### end Alembic commands ### diff --git a/spiffworkflow-backend/migrations/versions/2ec4222f0012_.py b/spiffworkflow-backend/migrations/versions/d45085c67790_.py similarity index 76% rename from spiffworkflow-backend/migrations/versions/2ec4222f0012_.py rename to spiffworkflow-backend/migrations/versions/d45085c67790_.py index 0cd0195a..fbb7211b 100644 --- a/spiffworkflow-backend/migrations/versions/2ec4222f0012_.py +++ b/spiffworkflow-backend/migrations/versions/d45085c67790_.py @@ -1,8 +1,8 @@ """empty message -Revision ID: 2ec4222f0012 +Revision ID: d45085c67790 Revises: -Create Date: 2023-01-24 10:31:26.693063 +Create Date: 2023-02-27 17:26:49.184535 """ from alembic import op @@ -10,7 +10,7 @@ import sqlalchemy as sa # revision identifiers, used by Alembic. -revision = '2ec4222f0012' +revision = 'd45085c67790' down_revision = None branch_labels = None depends_on = None @@ -18,20 +18,29 @@ depends_on = None def upgrade(): # ### commands auto generated by Alembic - please adjust! ### + op.create_table('correlation_property_cache', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('name', sa.String(length=50), nullable=False), + sa.Column('message_name', sa.String(length=50), nullable=False), + sa.Column('process_model_id', sa.String(length=255), nullable=False), + sa.Column('retrieval_expression', sa.String(length=255), nullable=True), + sa.PrimaryKeyConstraint('id') + ) op.create_table('group', sa.Column('id', sa.Integer(), nullable=False), sa.Column('name', sa.String(length=255), nullable=True), sa.Column('identifier', sa.String(length=255), nullable=True), sa.PrimaryKeyConstraint('id') ) - op.create_table('message_model', + op.create_table('message_triggerable_process_model', sa.Column('id', sa.Integer(), nullable=False), - sa.Column('identifier', sa.String(length=50), nullable=True), - sa.Column('name', sa.String(length=50), nullable=True), + sa.Column('message_name', sa.String(length=255), nullable=True), + sa.Column('process_model_identifier', sa.String(length=50), nullable=False), + sa.Column('updated_at_in_seconds', sa.Integer(), nullable=True), + sa.Column('created_at_in_seconds', sa.Integer(), nullable=True), sa.PrimaryKeyConstraint('id') ) - op.create_index(op.f('ix_message_model_identifier'), 'message_model', ['identifier'], unique=True) - op.create_index(op.f('ix_message_model_name'), 'message_model', ['name'], unique=True) + op.create_index(op.f('ix_message_triggerable_process_model_process_model_identifier'), 'message_triggerable_process_model', ['process_model_identifier'], unique=False) op.create_table('permission_target', sa.Column('id', sa.Integer(), nullable=False), sa.Column('uri', sa.String(length=255), nullable=False), @@ -76,34 +85,15 @@ def upgrade(): sa.Column('service_id', sa.String(length=255), nullable=False), sa.Column('display_name', sa.String(length=255), nullable=True), sa.Column('email', sa.String(length=255), nullable=True), + sa.Column('tenant_specific_field_1', sa.String(length=255), nullable=True), + sa.Column('tenant_specific_field_2', sa.String(length=255), nullable=True), + sa.Column('tenant_specific_field_3', sa.String(length=255), nullable=True), sa.Column('updated_at_in_seconds', sa.Integer(), nullable=True), sa.Column('created_at_in_seconds', sa.Integer(), nullable=True), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('service', 'service_id', name='service_key'), sa.UniqueConstraint('username') ) - op.create_table('message_correlation_property', - sa.Column('id', sa.Integer(), nullable=False), - sa.Column('identifier', sa.String(length=50), nullable=True), - sa.Column('message_model_id', sa.Integer(), nullable=False), - sa.Column('updated_at_in_seconds', sa.Integer(), nullable=True), - sa.Column('created_at_in_seconds', sa.Integer(), nullable=True), - sa.ForeignKeyConstraint(['message_model_id'], ['message_model.id'], ), - sa.PrimaryKeyConstraint('id'), - sa.UniqueConstraint('identifier', 'message_model_id', name='message_correlation_property_unique') - ) - op.create_index(op.f('ix_message_correlation_property_identifier'), 'message_correlation_property', ['identifier'], unique=False) - op.create_table('message_triggerable_process_model', - sa.Column('id', sa.Integer(), nullable=False), - sa.Column('message_model_id', sa.Integer(), nullable=False), - sa.Column('process_model_identifier', sa.String(length=50), nullable=False), - sa.Column('updated_at_in_seconds', sa.Integer(), nullable=True), - sa.Column('created_at_in_seconds', sa.Integer(), nullable=True), - sa.ForeignKeyConstraint(['message_model_id'], ['message_model.id'], ), - sa.PrimaryKeyConstraint('id'), - sa.UniqueConstraint('message_model_id') - ) - op.create_index(op.f('ix_message_triggerable_process_model_process_model_identifier'), 'message_triggerable_process_model', ['process_model_identifier'], unique=False) op.create_table('principal', sa.Column('id', sa.Integer(), nullable=False), sa.Column('user_id', sa.Integer(), nullable=True), @@ -201,6 +191,7 @@ def upgrade(): sa.Column('task_type', sa.String(length=50), nullable=True), sa.Column('task_status', sa.String(length=50), nullable=True), sa.Column('process_model_display_name', sa.String(length=255), nullable=True), + sa.Column('bpmn_process_identifier', sa.String(length=255), nullable=True), sa.Column('completed', sa.Boolean(), nullable=False), sa.ForeignKeyConstraint(['actual_owner_id'], ['user.id'], ), sa.ForeignKeyConstraint(['completed_by_user_id'], ['user.id'], ), @@ -209,35 +200,21 @@ def upgrade(): sa.PrimaryKeyConstraint('id') ) op.create_index(op.f('ix_human_task_completed'), 'human_task', ['completed'], unique=False) - op.create_table('message_correlation', - sa.Column('id', sa.Integer(), nullable=False), - sa.Column('process_instance_id', sa.Integer(), nullable=False), - sa.Column('message_correlation_property_id', sa.Integer(), nullable=False), - sa.Column('name', sa.String(length=255), nullable=False), - sa.Column('value', sa.String(length=255), nullable=False), - sa.Column('updated_at_in_seconds', sa.Integer(), nullable=True), - sa.Column('created_at_in_seconds', sa.Integer(), nullable=True), - sa.ForeignKeyConstraint(['message_correlation_property_id'], ['message_correlation_property.id'], ), - sa.ForeignKeyConstraint(['process_instance_id'], ['process_instance.id'], ), - sa.PrimaryKeyConstraint('id'), - sa.UniqueConstraint('process_instance_id', 'message_correlation_property_id', 'name', name='message_instance_id_name_unique') - ) - op.create_index(op.f('ix_message_correlation_message_correlation_property_id'), 'message_correlation', ['message_correlation_property_id'], unique=False) - op.create_index(op.f('ix_message_correlation_name'), 'message_correlation', ['name'], unique=False) - op.create_index(op.f('ix_message_correlation_process_instance_id'), 'message_correlation', ['process_instance_id'], unique=False) - op.create_index(op.f('ix_message_correlation_value'), 'message_correlation', ['value'], unique=False) op.create_table('message_instance', sa.Column('id', sa.Integer(), nullable=False), - sa.Column('process_instance_id', sa.Integer(), nullable=False), - sa.Column('message_model_id', sa.Integer(), nullable=False), + sa.Column('process_instance_id', sa.Integer(), nullable=True), + sa.Column('name', sa.String(length=255), nullable=True), sa.Column('message_type', sa.String(length=20), nullable=False), sa.Column('payload', sa.JSON(), nullable=True), + sa.Column('correlation_keys', sa.JSON(), nullable=True), sa.Column('status', sa.String(length=20), nullable=False), + sa.Column('user_id', sa.Integer(), nullable=False), + sa.Column('counterpart_id', sa.Integer(), nullable=True), sa.Column('failure_cause', sa.Text(), nullable=True), sa.Column('updated_at_in_seconds', sa.Integer(), nullable=True), sa.Column('created_at_in_seconds', sa.Integer(), nullable=True), - sa.ForeignKeyConstraint(['message_model_id'], ['message_model.id'], ), sa.ForeignKeyConstraint(['process_instance_id'], ['process_instance.id'], ), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), sa.PrimaryKeyConstraint('id') ) op.create_table('permission_assignment', @@ -268,7 +245,11 @@ def upgrade(): sa.Column('process_instance_id', sa.Integer(), nullable=False), sa.Column('spiff_step', sa.Integer(), nullable=False), sa.Column('task_json', sa.JSON(), nullable=False), - sa.Column('timestamp', sa.DECIMAL(precision=17, scale=6), nullable=False), + sa.Column('task_id', sa.String(length=50), nullable=False), + sa.Column('task_state', sa.String(length=50), nullable=False), + sa.Column('bpmn_task_identifier', sa.String(length=255), nullable=False), + sa.Column('start_in_seconds', sa.DECIMAL(precision=17, scale=6), nullable=False), + sa.Column('end_in_seconds', sa.DECIMAL(precision=17, scale=6), nullable=True), sa.ForeignKeyConstraint(['process_instance_id'], ['process_instance.id'], ), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('process_instance_id', 'spiff_step', name='process_instance_id_spiff_step') @@ -284,25 +265,25 @@ def upgrade(): ) op.create_index(op.f('ix_human_task_user_human_task_id'), 'human_task_user', ['human_task_id'], unique=False) op.create_index(op.f('ix_human_task_user_user_id'), 'human_task_user', ['user_id'], unique=False) - op.create_table('message_correlation_message_instance', + op.create_table('message_instance_correlation_rule', sa.Column('id', sa.Integer(), nullable=False), sa.Column('message_instance_id', sa.Integer(), nullable=False), - sa.Column('message_correlation_id', sa.Integer(), nullable=False), - sa.ForeignKeyConstraint(['message_correlation_id'], ['message_correlation.id'], ), + sa.Column('name', sa.String(length=50), nullable=False), + sa.Column('retrieval_expression', sa.String(length=255), nullable=True), + sa.Column('updated_at_in_seconds', sa.Integer(), nullable=True), + sa.Column('created_at_in_seconds', sa.Integer(), nullable=True), sa.ForeignKeyConstraint(['message_instance_id'], ['message_instance.id'], ), sa.PrimaryKeyConstraint('id'), - sa.UniqueConstraint('message_instance_id', 'message_correlation_id', name='message_correlation_message_instance_unique') + sa.UniqueConstraint('message_instance_id', 'name', name='message_instance_id_name_unique') ) - op.create_index(op.f('ix_message_correlation_message_instance_message_correlation_id'), 'message_correlation_message_instance', ['message_correlation_id'], unique=False) - op.create_index(op.f('ix_message_correlation_message_instance_message_instance_id'), 'message_correlation_message_instance', ['message_instance_id'], unique=False) + op.create_index(op.f('ix_message_instance_correlation_rule_message_instance_id'), 'message_instance_correlation_rule', ['message_instance_id'], unique=False) # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### - op.drop_index(op.f('ix_message_correlation_message_instance_message_instance_id'), table_name='message_correlation_message_instance') - op.drop_index(op.f('ix_message_correlation_message_instance_message_correlation_id'), table_name='message_correlation_message_instance') - op.drop_table('message_correlation_message_instance') + op.drop_index(op.f('ix_message_instance_correlation_rule_message_instance_id'), table_name='message_instance_correlation_rule') + op.drop_table('message_instance_correlation_rule') op.drop_index(op.f('ix_human_task_user_user_id'), table_name='human_task_user') op.drop_index(op.f('ix_human_task_user_human_task_id'), table_name='human_task_user') op.drop_table('human_task_user') @@ -311,11 +292,6 @@ def downgrade(): op.drop_table('process_instance_metadata') op.drop_table('permission_assignment') op.drop_table('message_instance') - op.drop_index(op.f('ix_message_correlation_value'), table_name='message_correlation') - op.drop_index(op.f('ix_message_correlation_process_instance_id'), table_name='message_correlation') - op.drop_index(op.f('ix_message_correlation_name'), table_name='message_correlation') - op.drop_index(op.f('ix_message_correlation_message_correlation_property_id'), table_name='message_correlation') - op.drop_table('message_correlation') op.drop_index(op.f('ix_human_task_completed'), table_name='human_task') op.drop_table('human_task') op.drop_table('user_group_assignment_waiting') @@ -329,10 +305,6 @@ def downgrade(): op.drop_index(op.f('ix_process_instance_process_model_display_name'), table_name='process_instance') op.drop_table('process_instance') op.drop_table('principal') - op.drop_index(op.f('ix_message_triggerable_process_model_process_model_identifier'), table_name='message_triggerable_process_model') - op.drop_table('message_triggerable_process_model') - op.drop_index(op.f('ix_message_correlation_property_identifier'), table_name='message_correlation_property') - op.drop_table('message_correlation_property') op.drop_table('user') op.drop_table('spiff_logging') op.drop_index(op.f('ix_spec_reference_cache_type'), table_name='spec_reference_cache') @@ -340,8 +312,8 @@ def downgrade(): op.drop_index(op.f('ix_spec_reference_cache_display_name'), table_name='spec_reference_cache') op.drop_table('spec_reference_cache') op.drop_table('permission_target') - op.drop_index(op.f('ix_message_model_name'), table_name='message_model') - op.drop_index(op.f('ix_message_model_identifier'), table_name='message_model') - op.drop_table('message_model') + op.drop_index(op.f('ix_message_triggerable_process_model_process_model_identifier'), table_name='message_triggerable_process_model') + op.drop_table('message_triggerable_process_model') op.drop_table('group') + op.drop_table('correlation_property_cache') # ### end Alembic commands ### diff --git a/spiffworkflow-backend/migrations/versions/d6e5b3af0908_.py b/spiffworkflow-backend/migrations/versions/d6e5b3af0908_.py deleted file mode 100644 index f47b4b57..00000000 --- a/spiffworkflow-backend/migrations/versions/d6e5b3af0908_.py +++ /dev/null @@ -1,28 +0,0 @@ -"""empty message - -Revision ID: d6e5b3af0908 -Revises: 9f0b1662a8af -Create Date: 2023-02-27 11:10:28.058014 - -""" -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision = 'd6e5b3af0908' -down_revision = '9f0b1662a8af' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('human_task', sa.Column('bpmn_process_identifier', sa.String(length=255), nullable=True)) - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.drop_column('human_task', 'bpmn_process_identifier') - # ### end Alembic commands ### diff --git a/spiffworkflow-backend/migrations/versions/e05ca5cdc312_.py b/spiffworkflow-backend/migrations/versions/e05ca5cdc312_.py deleted file mode 100644 index ab6d1b64..00000000 --- a/spiffworkflow-backend/migrations/versions/e05ca5cdc312_.py +++ /dev/null @@ -1,38 +0,0 @@ -"""empty message - -Revision ID: e05ca5cdc312 -Revises: ca9b79dde5cc -Create Date: 2023-02-08 12:21:41.722774 - -""" -from alembic import op -import sqlalchemy as sa -from sqlalchemy.dialects import mysql - -# revision identifiers, used by Alembic. -revision = 'e05ca5cdc312' -down_revision = 'ca9b79dde5cc' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('spiff_step_details', sa.Column('task_state', sa.String(length=50), nullable=False)) - op.add_column('spiff_step_details', sa.Column('task_id', sa.String(length=50), nullable=False)) - op.add_column('spiff_step_details', sa.Column('bpmn_task_identifier', sa.String(length=255), nullable=False)) - op.add_column('spiff_step_details', sa.Column('engine_step_start_in_seconds', sa.DECIMAL(precision=17, scale=6), nullable=True)) - op.add_column('spiff_step_details', sa.Column('engine_step_end_in_seconds', sa.DECIMAL(precision=17, scale=6), nullable=True)) - op.drop_column('spiff_step_details', 'timestamp') - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.add_column('spiff_step_details', sa.Column('timestamp', mysql.DECIMAL(precision=17, scale=6), nullable=False)) - op.drop_column('spiff_step_details', 'engine_step_end_in_seconds') - op.drop_column('spiff_step_details', 'engine_step_start_in_seconds') - op.drop_column('spiff_step_details', 'bpmn_task_identifier') - op.drop_column('spiff_step_details', 'task_id') - op.drop_column('spiff_step_details', 'task_state') - # ### end Alembic commands ###