[Eva] ты помнишь проблему с агентом Ева?) #58

Merged
Drobysh merged 4 commits from eva/chat-5b1483-backend into main 2026-11-02 09:48:33 +00:00
Showing only changes of commit 3dcc61c92f - Show all commits
+15
View File
@@ -244,6 +244,21 @@ async def init_db():
""")
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 ============
await conn.execute("""
CREATE TABLE IF NOT EXISTS sentences (