mirror of
https://github.com/rnvm9wjdtj-bot/myaps_api.git
synced 2026-06-02 05:54:40 +00:00
fix:监控用表增加索引迁移脚本
This commit is contained in:
@@ -124,6 +124,13 @@ async def migrate():
|
||||
|
||||
for table, indexes in INDEX_DEFINITIONS.items():
|
||||
logger.info(f"处理表: {table}")
|
||||
|
||||
# 检查表是否存在
|
||||
if not await check_table_exists(client, table):
|
||||
logger.info(f"表不存在,跳过所有索引: {table}")
|
||||
skipped_count += len(indexes)
|
||||
continue
|
||||
|
||||
for index_name, columns in indexes.items():
|
||||
result = await create_index(client, table, index_name, columns)
|
||||
if result:
|
||||
|
||||
Reference in New Issue
Block a user