fix(safe-history-indexes): Guard 0039 indexes against missing historical columns (LANG-135)

This commit is contained in:
Chin Rock
2026-10-20 07:54:02 +00:00
parent 1baba1b9f9
commit 4d91903596
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)