fixed the downgrade in new migration w/ burnettk

This commit is contained in:
jasquat 2023-03-01 15:54:50 -05:00
parent 683308da54
commit 596e3d580d
No known key found for this signature in database
2 changed files with 7 additions and 3 deletions

View File

@ -53,10 +53,14 @@ if [[ "${1:-}" == "clean" ]]; then
docker exec -it postgres-spiff psql -U spiffworkflow_backend spiffworkflow_backend_unit_testing -c "create database spiffworkflow_backend_local_development;"
fi
fi
tasks="$tasks upgrade"
elif [[ "${1:-}" == "migrate" ]]; then
tasks="$tasks migrate"
elif [[ "${1:-}" == "downgrade" ]]; then
tasks="$tasks downgrade"
else
tasks="$tasks upgrade"
fi
tasks="$tasks upgrade"
if [[ "${SPIFFWORKFLOW_BACKEND_DATABASE_TYPE:-mysql}" == "mysql" ]]; then
mysql -uroot -e "CREATE DATABASE IF NOT EXISTS spiffworkflow_backend_local_development"

View File

@ -41,8 +41,8 @@ def upgrade():
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('spiff_step_details', 'delta_json')
op.drop_constraint(None, 'process_instance', type_='foreignkey')
op.drop_constraint(None, 'process_instance', type_='foreignkey')
op.drop_constraint('process_instance_ibfk_3', 'process_instance', type_='foreignkey')
op.drop_constraint('process_instance_ibfk_2', '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')