From 70c63ae4d542e165a06a551dd8607c8421a061bb Mon Sep 17 00:00:00 2001 From: Conrad Hoffmann Date: Fri, 2 Dec 2022 15:15:02 +0100 Subject: [PATCH] alembic: fix broken downgrade --- .../7e863c9389ef_configure_cascades_on_relationships.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildsrht/alembic/versions/7e863c9389ef_configure_cascades_on_relationships.py b/buildsrht/alembic/versions/7e863c9389ef_configure_cascades_on_relationships.py index 8d7973c..af88665 100644 --- a/buildsrht/alembic/versions/7e863c9389ef_configure_cascades_on_relationships.py +++ b/buildsrht/alembic/versions/7e863c9389ef_configure_cascades_on_relationships.py @@ -37,7 +37,7 @@ def upgrade(): def downgrade(): - for (table, relation, col, do) in tables: + for (table, relation, col, do) in cascades: op.execute(f""" ALTER TABLE {table} DROP CONSTRAINT IF EXISTS {table}_{col}_fkey; ALTER TABLE {table} ADD CONSTRAINT {table}_{col}_fkey FOREIGN KEY ({col}) REFERENCES "{relation}"(id); -- 2.38.5