mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-09 22:00:01 +08:00
版本更新
This commit is contained in:
@@ -4,7 +4,6 @@ from zhenxun.services.db_context import Model
|
||||
|
||||
|
||||
class Statistics(Model):
|
||||
|
||||
id = fields.IntField(pk=True, generated=True, auto_increment=True)
|
||||
"""自增id"""
|
||||
user_id = fields.CharField(255)
|
||||
@@ -15,15 +14,19 @@ class Statistics(Model):
|
||||
"""插件名称"""
|
||||
create_time = fields.DatetimeField(auto_now=True)
|
||||
"""添加日期"""
|
||||
bot_id = fields.CharField(255, null=True)
|
||||
"""Bot Id"""
|
||||
|
||||
class Meta:
|
||||
class Meta: # type: ignore
|
||||
table = "statistics"
|
||||
table_description = "插件调用统计数据库"
|
||||
|
||||
@classmethod
|
||||
async def _run_script(cls):
|
||||
return [
|
||||
"ALTER TABLE statistics RENAME COLUMN user_qq TO user_id;", # 将user_qq改为user_id
|
||||
"ALTER TABLE statistics RENAME COLUMN user_qq TO user_id;",
|
||||
# 将user_qq改为user_id
|
||||
"ALTER TABLE statistics ALTER COLUMN user_id TYPE character varying(255);",
|
||||
"ALTER TABLE statistics ALTER COLUMN group_id TYPE character varying(255);",
|
||||
"ALTER TABLE statistics ADD bot_id Text DEFAULT '';",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user