From f78a1fa19fe9bbc8613d176d5b916acc1130460f Mon Sep 17 00:00:00 2001 From: Drobysh Date: Tue, 13 Oct 2026 11:46:06 +0000 Subject: [PATCH] =?UTF-8?q?[Eva]=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BC=D0=B8=D0=B3=D1=80=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20users.difficulty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- database.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/database.py b/database.py index 1cb57d8..be06b58 100644 --- a/database.py +++ b/database.py @@ -1299,6 +1299,17 @@ async def init_db(): """) logger.info("Added apple_id column to users (Pleily)") + # difficulty + col_exists = await conn.fetchval(""" + SELECT 1 FROM information_schema.columns + WHERE table_name = 'users' AND column_name = 'difficulty' + """) + if not col_exists: + await conn.execute(""" + ALTER TABLE users ADD COLUMN difficulty TEXT DEFAULT 'medium' + """) + logger.info("Added difficulty column to users (Pleily)") + # app_user_id_seq — sequence для отрицательных user_id await conn.execute(""" CREATE SEQUENCE IF NOT EXISTS app_user_id_seq