mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-30 06:07:14 +00:00
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:
@@ -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),
|
||||||
|
|||||||
Reference in New Issue
Block a user