Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NumberSir committed May 4, 2023
1 parent 6012b0e commit 9df9073
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion nonebot_plugin_arktools/src/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ async def _(args: Message = CommandArg()):
if args.extract_plain_text().strip() == "-D":
await ArknightsDB.drop_data()
await update_game_resource.send("已彻底删除原表,开始重新写入数据库……")
await ArknightsDB.init_data(force=True)
await ArknightsDB.init_db()
else:
await ArknightsDB.init_data(force=True)
await update_game_resource.finish("游戏数据库更新完成!")


Expand Down
2 changes: 1 addition & 1 deletion nonebot_plugin_arktools/src/utils/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async def init_data(force: bool = False):
await ArknightsDB._init_skill(force)
await ArknightsDB._init_skin(force)
await ArknightsDB._init_stage(force)
except tortoise.exceptions.BaseORMException as e:
except (tortoise.exceptions.OperationalError, tortoise.exceptions.FieldError) as e:
logger.error(f"数据库初始化出错: {e}")
await ArknightsDB.drop_data()
await ArknightsDB.init_db()
Expand Down

0 comments on commit 9df9073

Please sign in to comment.