Skip to content

Commit

Permalink
Merge pull request #329 from SK-415/dev
Browse files Browse the repository at this point in the history
Release v1.5.3.post1
  • Loading branch information
SK-415 authored Feb 9, 2023
2 parents 8c4fb62 + 12af870 commit efdf9da
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ HarukaBot 针对不同的推送场景(粉丝群、娱乐群、直播通知群
- [go-cqhttp](https://github.com/Mrs4s/go-cqhttp):稳定完善的 CQHTTP 实现。
- [bilibili-API-collect](https://github.com/SocialSisterYi/bilibili-API-collect):非常详细的 B 站 API 文档。
- [bilibili_api](https://github.com/Passkou/bilibili_api):Python 实现的 B 站 API 库。
- [HarukaBot_Guild_Patch](https://github.com/17TheWord/HarukaBot_Guild_Patch) 可以让HarukaBot适用于频道的补丁。
- [HarukaBot_Guild_Patch](https://github.com/17TheWord/HarukaBot_Guild_Patch) 可以让HarukaBot适用于频道的补丁。(已合入 HarukaBot)

## 支持与贡献

Expand Down
22 changes: 17 additions & 5 deletions haruka_bot/database/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,24 @@ class DB:
@classmethod
async def init(cls):
"""初始化数据库"""
from . import models # noqa: F401
config = {
"connections": {
# "haruka_bot": {
# "engine": "tortoise.backends.sqlite",
# "credentials": {"file_path": get_path("data.sqlite3")},
# },
"haruka_bot": f"sqlite://{get_path('data.sqlite3')}"
},
"apps": {
"haruka_bot_app": {
"models": ["haruka_bot.database.models"],
"default_connection": "haruka_bot",
}
},
}

await Tortoise.init(config)

await Tortoise.init(
db_url=f"sqlite://{get_path('data.sqlite3')}",
modules={"models": [locals()["models"]]},
)
await Tortoise.generate_schemas()
await cls.migrate()
await cls.update_uid_list()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies = [
"nonebot-plugin-guild-patch~=0.2",
]
name = "haruka-bot"
version = "1.5.3"
version = "1.5.3.post1"
description = "Push dynamics and live informations from bilibili to QQ. Based on nonebot2."
readme = "README.md"
keywords = ["nonebot", "nonebot2", "qqbot", "bilibili", "bot"]
Expand Down

0 comments on commit efdf9da

Please sign in to comment.