From 9b195cdbd32bb0415c216ce42e6b11b09582e9ac Mon Sep 17 00:00:00 2001 From: mihalin Date: Fri, 17 Sep 2021 11:56:38 +0300 Subject: [PATCH] group chat name length --- olgram/migrations/models/3_20210917115559_update.sql | 4 ++++ olgram/models/models.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 olgram/migrations/models/3_20210917115559_update.sql diff --git a/olgram/migrations/models/3_20210917115559_update.sql b/olgram/migrations/models/3_20210917115559_update.sql new file mode 100644 index 0000000..f5d22e0 --- /dev/null +++ b/olgram/migrations/models/3_20210917115559_update.sql @@ -0,0 +1,4 @@ +-- upgrade -- +ALTER TABLE "group_chat" ALTER COLUMN "name" TYPE VARCHAR(255) USING "name"::VARCHAR(255); +-- downgrade -- +ALTER TABLE "group_chat" ALTER COLUMN "name" TYPE VARCHAR(50) USING "name"::VARCHAR(50); diff --git a/olgram/models/models.py b/olgram/models/models.py index b597ac9..92aa08e 100644 --- a/olgram/models/models.py +++ b/olgram/models/models.py @@ -42,7 +42,7 @@ class User(Model): class GroupChat(Model): id = fields.IntField(pk=True) chat_id = fields.BigIntField(index=True, unique=True) - name = fields.CharField(max_length=50) + name = fields.CharField(max_length=255) class Meta: table = 'group_chat'