[Eva] Добавлена колонка found_words в user_progress

This commit is contained in:
2026-11-02 09:47:30 +00:00
parent 4e444499d4
commit 3dcc61c92f
+15
View File
@@ -244,6 +244,21 @@ async def init_db():
""") """)
logger.info("Added wave column to user_progress") logger.info("Added wave column to user_progress")
# ============ Авто-миграция: добавляем found_words в user_progress ============
# 🔧 НОВОЕ (02.11.2026): found_words — список уже найденных слов уровня.
# Нужен, чтобы (1) повторный свайп найденного слова не накручивал
# серию и (2) complete-level мог проверить, что все слова найдены.
col_exists = await conn.fetchval("""
SELECT 1 FROM information_schema.columns
WHERE table_name = 'user_progress' AND column_name = 'found_words'
""")
if not col_exists:
await conn.execute("""
ALTER TABLE user_progress
ADD COLUMN found_words TEXT[] DEFAULT '{}'
""")
logger.info("Added found_words column to user_progress")
# ============ sentences ============ # ============ sentences ============
await conn.execute(""" await conn.execute("""
CREATE TABLE IF NOT EXISTS sentences ( CREATE TABLE IF NOT EXISTS sentences (