Skip to content

Commit

Permalink
fix migrations downgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
joelclems committed Dec 7, 2023
1 parent f06c8ef commit 78d735f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def upgrade():


def downgrade():
op.drop_table("t_module_complements", monitorings_schema)
op.drop_table("t_observation_complements", monitorings_schema)
op.drop_table("t_observation_details", monitorings_schema)
op.drop_table("t_observations", monitorings_schema)
op.drop_table("t_site_complements", monitorings_schema)
op.drop_table("t_sites_groups", monitorings_schema)
op.drop_table("t_visit_complements", monitorings_schema)
op.drop_table("t_module_complements", schema=monitorings_schema)
op.drop_table("t_observation_complements", schema=monitorings_schema)
op.drop_table("t_observation_details", schema=monitorings_schema)
op.drop_table("t_observations", schema=monitorings_schema)
op.drop_table("t_site_complements", schema=monitorings_schema)
op.drop_table("t_sites_groups", schema=monitorings_schema)
op.drop_table("t_visit_complements", schema=monitorings_schema)

# Remove all GNM related objects
statement = sa.delete(TObjects).where(TObjects.code_object.like("GNM_%"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def upgrade():
def downgrade():
statement = sa.text(
f"""
ALTER TABLE {monitorings_schema}.{table} DROP CONSTRAINT fk_t_sites_groups_id_digitiser;
ALTER TABLE {monitorings_schema}.{table} DROP CONSTRAINT fk_{table}_{column};
"""
)
op.execute(statement)
Expand Down

0 comments on commit 78d735f

Please sign in to comment.