From 546075236d2155732d0a64d3efdf3601bea8788d Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 31 Mar 2023 02:48:08 +0300 Subject: [PATCH 1/2] fix: change docker-compose version to 2.4 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index cbee580..68daa26 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.3' +version: '2.4' services: bot: From 26a95d225db5204711db19d5f3bcc46fe539a359 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 31 Mar 2023 02:48:36 +0300 Subject: [PATCH 2/2] fix: switch to server_default --- alembic/versions/73ffa12c03c8_initial.py | 2 +- tgbot/models/user.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alembic/versions/73ffa12c03c8_initial.py b/alembic/versions/73ffa12c03c8_initial.py index de91f58..9fa0984 100644 --- a/alembic/versions/73ffa12c03c8_initial.py +++ b/alembic/versions/73ffa12c03c8_initial.py @@ -22,7 +22,7 @@ def upgrade() -> None: sa.Column('username', sa.String(length=32), nullable=True), sa.Column('first_name', sa.String(length=255), nullable=True), sa.Column('last_name', sa.String(length=255), nullable=True), - sa.Column('is_banned', sa.Boolean(), nullable=False), + sa.Column('is_banned', sa.Boolean(), server_default='False', nullable=False), sa.Column('deep_link', sa.String(length=225), nullable=True), sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True), sa.Column('updated_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True), diff --git a/tgbot/models/user.py b/tgbot/models/user.py index 64117c0..ed56630 100644 --- a/tgbot/models/user.py +++ b/tgbot/models/user.py @@ -8,5 +8,5 @@ class User(TimedBaseModel): username = db.Column(db.String(32), nullable=True) first_name = db.Column(db.String(255), nullable=True) last_name = db.Column(db.String(255), nullable=True) - is_banned = db.Column(db.Boolean, nullable=False, default=False) + is_banned = db.Column(db.Boolean, server_default="False", nullable=False) deep_link = db.Column(db.String(225), nullable=True)