[Eva] Ева, патч 21 применён — теперь ты можешь #41

Merged
Drobysh merged 8 commits from eva/chat-b7c183-backend into main 2026-10-14 09:25:07 +00:00
Showing only changes of commit 13fcc8240d - Show all commits
+40
View File
@@ -898,6 +898,46 @@ async def init_db():
""")
logger.info("Added current_hints_used column to bubble_words_progress")
# 🔧 НОВОЕ (14.10.2026): current_list_opened — серверный счётчик
# «показать слова» для текущего уровня пузырей. Medium — 1 раз.
col_exists = await conn.fetchval("""
SELECT 1 FROM information_schema.columns
WHERE table_name = 'bubble_words_progress' AND column_name = 'current_list_opened'
""")
if not col_exists:
await conn.execute("""
ALTER TABLE bubble_words_progress
ADD COLUMN current_list_opened INT DEFAULT 0
""")
logger.info("Added current_list_opened column to bubble_words_progress")
# 🔧 НОВОЕ (14.10.2026): current_level_words — состояние текущего
# уровня пузырей (слова + части + переводы). Нужно для подсказок,
# т.к. уровень генерируется на лету в /next и нигде не хранится.
col_exists = await conn.fetchval("""
SELECT 1 FROM information_schema.columns
WHERE table_name = 'bubble_words_progress' AND column_name = 'current_level_words'
""")
if not col_exists:
await conn.execute("""
ALTER TABLE bubble_words_progress
ADD COLUMN current_level_words JSONB DEFAULT '[]'::jsonb
""")
logger.info("Added current_level_words column to bubble_words_progress")
# 🔧 НОВОЕ (14.10.2026): hinted_words — какие слова уже получили
# подсказку «первая часть» (для «каждый раз разное слово»).
col_exists = await conn.fetchval("""
SELECT 1 FROM information_schema.columns
WHERE table_name = 'bubble_words_progress' AND column_name = 'hinted_words'
""")
if not col_exists:
await conn.execute("""
ALTER TABLE bubble_words_progress
ADD COLUMN hinted_words TEXT[] DEFAULT '{}'
""")
logger.info("Added hinted_words column to bubble_words_progress")
# ============ wrong_because_explanations ============
await conn.execute("""
CREATE TABLE IF NOT EXISTS wrong_because_explanations (