From ea2e3fc5ed4446061e70239e14ee17d965c13b0b Mon Sep 17 00:00:00 2001 From: thomasallen Date: Tue, 7 Apr 2026 14:13:04 -0700 Subject: [PATCH] Alembic upgrade fix --- alembic/versions/835999dfb9e3_add_scix_id.py | 4 ++-- .../9a4b1e8b6c7d_add_publication_year_and_refereed_status.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/alembic/versions/835999dfb9e3_add_scix_id.py b/alembic/versions/835999dfb9e3_add_scix_id.py index 962b133..1db2c47 100644 --- a/alembic/versions/835999dfb9e3_add_scix_id.py +++ b/alembic/versions/835999dfb9e3_add_scix_id.py @@ -19,7 +19,7 @@ def upgrade(): bind = op.get_bind() inspector = sa.inspect(bind) - if not inspector.has_table("resolved_reference"): + if "resolved_reference" not in inspector.get_table_names(): raise RuntimeError( "Migration 835999dfb9e3 requires table `resolved_reference`, " "but it does not exist. Database schema and alembic_version are out of sync." @@ -32,7 +32,7 @@ def upgrade(): def downgrade(): bind = op.get_bind() inspector = sa.inspect(bind) - if not inspector.has_table("resolved_reference"): + if "resolved_reference" not in inspector.get_table_names(): return columns = {c["name"] for c in inspector.get_columns("resolved_reference")} if "scix_id" in columns: diff --git a/alembic/versions/9a4b1e8b6c7d_add_publication_year_and_refereed_status.py b/alembic/versions/9a4b1e8b6c7d_add_publication_year_and_refereed_status.py index 1279978..9736b39 100644 --- a/alembic/versions/9a4b1e8b6c7d_add_publication_year_and_refereed_status.py +++ b/alembic/versions/9a4b1e8b6c7d_add_publication_year_and_refereed_status.py @@ -19,7 +19,7 @@ def upgrade(): bind = op.get_bind() inspector = sa.inspect(bind) - if not inspector.has_table("resolved_reference"): + if "resolved_reference" not in inspector.get_table_names(): raise RuntimeError( "Migration 9a4b1e8b6c7d requires table `resolved_reference`, " "but it does not exist. Database schema and alembic_version are out of sync." @@ -35,7 +35,7 @@ def upgrade(): def downgrade(): bind = op.get_bind() inspector = sa.inspect(bind) - if not inspector.has_table("resolved_reference"): + if "resolved_reference" not in inspector.get_table_names(): return columns = {c["name"] for c in inspector.get_columns("resolved_reference")}