mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-24 01:15:24 +08:00
fix(safe-history-indexes): Guard 0039 indexes against missing historical columns (LANG-135)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user