mirror of
https://github.com/civsocit/olgram.git
synced 2023-07-22 01:29:12 +03:00
bigint Для идентифкаторов чатов
This commit is contained in:
parent
d2351d5964
commit
2a7def4809
6
olgram/migrations/models/2_20210911182503_update.sql
Normal file
6
olgram/migrations/models/2_20210911182503_update.sql
Normal 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;
|
@ -33,7 +33,7 @@ class Bot(Model):
|
|||||||
|
|
||||||
class User(Model):
|
class User(Model):
|
||||||
id = fields.IntField(pk=True)
|
id = fields.IntField(pk=True)
|
||||||
telegram_id = fields.IntField(index=True, unique=True)
|
telegram_id = fields.BigIntField(index=True, unique=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
table = 'user'
|
table = 'user'
|
||||||
@ -41,7 +41,7 @@ class User(Model):
|
|||||||
|
|
||||||
class GroupChat(Model):
|
class GroupChat(Model):
|
||||||
id = fields.IntField(pk=True)
|
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)
|
name = fields.CharField(max_length=50)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
Loading…
Reference in New Issue
Block a user