feat: мини-игры, premium подписка, улучшенные контексты
Мини-игры (/games): - Speed Round: 10 раундов, 10 секунд на ответ, очки за скорость - Match Pairs: 5 слов + 5 переводов, соединить пары Premium-функции: - Поля is_premium и premium_until для пользователей - AI режим проверки ответов (учитывает синонимы) - Batch проверка всех ответов одним запросом Улучшения: - Примеры использования для всех добавляемых слов - Разбиение переводов по запятой на отдельные записи - Полные предложения в контекстах (без ___) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
29
migrations/versions/20251210_add_is_premium.py
Normal file
29
migrations/versions/20251210_add_is_premium.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""Add is_premium and premium_until fields to users
|
||||
|
||||
Revision ID: 20251210_is_premium
|
||||
Revises: 20251209_story_translation
|
||||
Create Date: 2025-12-10
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '20251210_is_premium'
|
||||
down_revision: Union[str, None] = '20251209_story_translation'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column('users', sa.Column('is_premium', sa.Boolean(), nullable=True, server_default='false'))
|
||||
op.add_column('users', sa.Column('premium_until', sa.DateTime(), nullable=True))
|
||||
op.execute("UPDATE users SET is_premium = false WHERE is_premium IS NULL")
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column('users', 'premium_until')
|
||||
op.drop_column('users', 'is_premium')
|
||||
Reference in New Issue
Block a user