bigint Для идентифкаторов чатов

This commit is contained in:
mihalin 2021-09-11 18:27:04 +03:00
parent d2351d5964
commit 2a7def4809
2 changed files with 8 additions and 2 deletions

View File

@ -0,0 +1,6 @@
-- upgrade --
ALTER TABLE "group_chat" ALTER COLUMN "chat_id" TYPE BIGINT USING "chat_id"::BIGINT;
ALTER TABLE "user" ALTER COLUMN "telegram_id" TYPE BIGINT USING "telegram_id"::BIGINT;
-- downgrade --
ALTER TABLE "user" ALTER COLUMN "telegram_id" TYPE INT USING "telegram_id"::INT;
ALTER TABLE "group_chat" ALTER COLUMN "chat_id" TYPE INT USING "chat_id"::INT;

View File

@ -33,7 +33,7 @@ class Bot(Model):
class User(Model):
id = fields.IntField(pk=True)
telegram_id = fields.IntField(index=True, unique=True)
telegram_id = fields.BigIntField(index=True, unique=True)
class Meta:
table = 'user'
@ -41,7 +41,7 @@ class User(Model):
class GroupChat(Model):
id = fields.IntField(pk=True)
chat_id = fields.IntField(index=True, unique=True)
chat_id = fields.BigIntField(index=True, unique=True)
name = fields.CharField(max_length=50)
class Meta: