🤖 自动格式化代码 [skip ci]
This commit is contained in:
@@ -391,11 +391,7 @@ class EmojiManager:
|
|||||||
# if not self._initialized:
|
# if not self._initialized:
|
||||||
# try:
|
# try:
|
||||||
# # Ensure Peewee database connection is up and tables are created
|
# # Ensure Peewee database connection is up and tables are created
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# self._initialized = True
|
# self._initialized = True
|
||||||
# except Exception as e:
|
# except Exception as e:
|
||||||
# logger.exception(f"初始化表情管理器失败: {e}")
|
# logger.exception(f"初始化表情管理器失败: {e}")
|
||||||
|
|||||||
@@ -336,9 +336,7 @@ def initialize_database():
|
|||||||
model_fields = model._meta.fields
|
model_fields = model._meta.fields
|
||||||
for field_name in model_fields:
|
for field_name in model_fields:
|
||||||
if field_name not in existing_columns:
|
if field_name not in existing_columns:
|
||||||
logger.error(
|
logger.error(f"表 '{table_name}' 缺失字段 '{field_name}',请手动迁移数据库结构后重启程序。")
|
||||||
f"表 '{table_name}' 缺失字段 '{field_name}',请手动迁移数据库结构后重启程序。"
|
|
||||||
)
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception(f"检查表或字段是否存在时出错: {e}")
|
logger.exception(f"检查表或字段是否存在时出错: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user