Merge pull request #2730 from langbot-app/task/LANG-135-safe-history-indexes

LANG-135: Guard 0039 indexes against missing historical columns
This commit is contained in:
RockChinQ
2026-10-20 18:11:30 +08:00
committed by GitHub
2 changed files with 38 additions and 0 deletions
@@ -33,6 +33,8 @@ def upgrade():
for table, index, columns in INDEXES:
if not inspector.has_table(table):
continue
if not set(columns) <= {column['name'] for column in inspector.get_columns(table)}:
continue
# Fresh installations create these indexes from ORM metadata before migrations.
if index not in {item['name'] for item in inspector.get_indexes(table)}:
op.create_index(index, table, columns)