mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-14 00:20:06 +08:00
🐛 修改bug
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import ujson as json
|
||||
from nonebot.utils import is_coroutine_callable
|
||||
from tortoise import Tortoise, fields
|
||||
from tortoise import Tortoise
|
||||
from tortoise.connection import connections
|
||||
from tortoise.models import Model as Model_
|
||||
|
||||
@@ -17,10 +17,8 @@ from zhenxun.configs.path_config import DATA_PATH
|
||||
|
||||
from .log import logger
|
||||
|
||||
MODELS: list[str] = []
|
||||
|
||||
SCRIPT_METHOD = []
|
||||
|
||||
MODELS: list[str] = []
|
||||
DATABASE_SETTING_FILE = DATA_PATH / "database.json"
|
||||
|
||||
|
||||
@@ -39,16 +37,6 @@ class Model(Model_):
|
||||
SCRIPT_METHOD.append((cls.__module__, func))
|
||||
|
||||
|
||||
class TestSQL(Model):
|
||||
id = fields.IntField(pk=True, generated=True, auto_increment=True)
|
||||
"""自增id"""
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
table = "test_sql"
|
||||
table_description = "执行SQL命令,不记录任何数据"
|
||||
|
||||
|
||||
async def init():
|
||||
if DATABASE_SETTING_FILE.exists():
|
||||
with open(DATABASE_SETTING_FILE, "r", encoding="utf-8") as f:
|
||||
|
||||
Reference in New Issue
Block a user