fix: scope reliability migration indexes

This commit is contained in:
2026-08-04 11:25:47 +08:00
parent fee707f42d
commit e12cda3906
2 changed files with 49 additions and 4 deletions
@@ -105,9 +105,13 @@ def _create_missing_indexes(connection: Connection) -> None:
existing_indexes = {
index["name"] for index in inspector.get_indexes(table.name)
}
for index in table.indexes:
if index.name not in existing_indexes:
index.create(bind=connection)
index = next(
item
for item in table.indexes
if item.name == "idx_ping_records_device_created_at"
)
if index.name not in existing_indexes:
index.create(bind=connection)
def _upgrade_postgresql_alert_type(connection: Connection) -> None: