fix(alembic): check if rerank_models table exists before creating

Migration 0003 failed when rerank_models table already exists from create_all().
Add table existence check to prevent duplicate creation error in CI environments with cached database.
This commit is contained in:
huanghuoguoguo
2026-04-20 23:43:48 +08:00
parent 3115d6f6dd
commit a8fba46040
@@ -15,6 +15,10 @@ depends_on = None
def upgrade() -> None: def upgrade() -> None:
# Check if table already exists (may have been created by create_all())
conn = op.get_bind()
inspector = sa.inspect(conn)
if 'rerank_models' not in inspector.get_table_names():
op.create_table( op.create_table(
'rerank_models', 'rerank_models',
sa.Column('uuid', sa.String(255), primary_key=True, unique=True), sa.Column('uuid', sa.String(255), primary_key=True, unique=True),