Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 添加 tortoise_orm 共通支持 #52

Merged
merged 3 commits into from
Aug 22, 2023

Conversation

kexue-z
Copy link
Contributor

@kexue-z kexue-z commented Aug 21, 2023

尝试 fix #51
搞定 #34
解决 kexue-z/nonebot-plugin-setu-now#54 (comment)

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

@kexue-z
Copy link
Contributor Author

kexue-z commented Aug 21, 2023

使用 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
Copy link
Owner

CMHopeSunshine commented Aug 21, 2023

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

@kexue-z
Copy link
Contributor Author

kexue-z commented Aug 21, 2023

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

@kexue-z
Copy link
Contributor Author

kexue-z commented Aug 22, 2023

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

验证一下?

@CMHopeSunshine CMHopeSunshine merged commit 95a3e10 into CMHopeSunshine:master Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

插件冲突,建议使用共通上游
2 participants