diff --git a/spiffworkflow-backend/bin/recreate_db b/spiffworkflow-backend/bin/recreate_db index 2a10401ef..9204fb1c3 100755 --- a/spiffworkflow-backend/bin/recreate_db +++ b/spiffworkflow-backend/bin/recreate_db @@ -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" diff --git a/spiffworkflow-backend/migrations/versions/7422be14adc4_.py b/spiffworkflow-backend/migrations/versions/7422be14adc4_.py index 810696edf..6897e0f21 100644 --- a/spiffworkflow-backend/migrations/versions/7422be14adc4_.py +++ b/spiffworkflow-backend/migrations/versions/7422be14adc4_.py @@ -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')