CMHopeSunshine / nonebot-plugin-learning-chat

Nonebot2插件,让Bot学习群友的发言和表情包。/ Nonebot2 plugin to learn what your group members say.
GNU Affero General Public License v3.0
165 stars 6 forks source link

🐛 添加 tortoise_orm 共通支持 #52

Closed kexue-z closed 1 year ago

kexue-z commented 1 year ago

尝试 fix #51 搞定 #34 解决 https://github.com/kexue-z/nonebot-plugin-setu-now/issues/54#issuecomment-1685428382

至于PR里面有些给你给你格式化了,都是 black 干的(

kexue-z commented 1 year ago
使用 Python: D:\临时\bot\setu-test\.venv\Scripts\python.exe
08-21 15:34:17 [SUCCESS] nonebot | NoneBot is initializing...
08-21 15:34:17 [INFO] nonebot | Current Env: prod
08-21 15:34:18 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_localstore"
08-21 15:34:18 [WARNING] nonebot_plugin_tortoise_orm | 没有设置数据库地址, 使用 sqlite:///C:\Users\****\AppData\Local\nonebot2\db.sqlite3
08-21 15:34:18 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_tortoise_orm"
08-21 15:34:18 [SUCCESS] nonebot_plugin_tortoise_orm | 数据库: 添加模型: nonebot_plugin_setu_now.database
08-21 15:34:18 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_setu_now"
08-21 15:34:18 [SUCCESS] nonebot_plugin_tortoise_orm | 数据库: 添加模型: nonebot_plugin_learning_chat.models     
08-21 15:34:22 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_apscheduler"
08-21 15:34:22 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_learning_chat"
08-21 15:34:22 [SUCCESS] nonebot | Running NoneBot...
08-21 15:34:22 [INFO] uvicorn | Started server process [1812]
08-21 15:34:22 [INFO] uvicorn | Waiting for application startup.
08-21 15:34:22 [SUCCESS] nonebot_plugin_tortoise_orm | 数据库: 连接成功 URL: sqlite:///C:\Users\****\AppData\Local\nonebot2\db.sqlite3
08-21 15:34:22 [INFO] nonebot_plugin_apscheduler | Scheduler Started
08-21 15:34:22 [INFO] uvicorn | Application startup complete.
08-21 15:34:22 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:8080 (Press CTRL+C to quit
CMHopeSunshine commented 1 year ago

数据库文件位置改变了,旧数据没有进行迁移,不太好。后续我准备更换sqlalchemy的(可恶的tortoise)。

kexue-z commented 1 year ago

如果我超下这个 https://github.com/CMHopeSunshine/LittlePaimon/blob/d1f345e730fa204f38a29f992cb26b41b86cf364/LittlePaimon/database/__init__.py#L62 放在 nonebot-plugin-tortoise-orm 这样数据库位置应该可以不变的

kexue-z commented 1 year ago

更新了,旧数据库也能继续用了?

验证一下?