🧱 Update the 'user_qq' field in the database to 'user_id'

This commit is contained in:
yajiwa
2023-04-14 11:45:45 +08:00
parent 08c7aae6b7
commit 04c516f783
9 changed files with 201 additions and 152 deletions
+5 -4
View File
@@ -8,7 +8,7 @@ from services.log import logger
class GroupInfo(Model):
group_id = fields.BigIntField(pk=True)
group_id = fields.CharField(255, pk=True)
"""群聊id"""
group_name = fields.TextField(default="")
"""群聊名称"""
@@ -25,6 +25,7 @@ class GroupInfo(Model):
@classmethod
def _run_script(cls):
return [
"ALTER TABLE group_info ADD group_flag Integer NOT NULL DEFAULT 0;" # group_info表添加一个group_flag
]
return ["ALTER TABLE group_info ADD group_flag Integer NOT NULL DEFAULT 0;", # group_info表添加一个group_flag
"ALTER TABLE group_info ALTER COLUMN group_id TYPE character varying(255);"
# 将group_id字段类型改为character varying(255)
]