Add player_name column to games (migration included), with regex-based validation and anti-abuse sanitization. New /scoreboard page shows recent games from localStorage, popular categories with play counts, and top-10 per-category leaderboards sorted by completion time. Also includes two-click reverse word matching, base URL prefix support for reverse-proxy hosting, BasePageHandler refactoring, themed table CSS for all 5 themes, and comprehensive test coverage for player names and scoreboard API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
41 lines
1000 B
Python
41 lines
1000 B
Python
"""add player_name to games
|
|
|
|
Revision ID: 3a2aa8e15433
|
|
Revises: 71016fe57b9d
|
|
Create Date: 2026-05-07 02:32:19.229401
|
|
|
|
"""
|
|
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = "3a2aa8e15433"
|
|
down_revision: Union[str, Sequence[str], None] = "71016fe57b9d"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
"""Upgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.add_column(
|
|
"games",
|
|
sa.Column(
|
|
"player_name",
|
|
sa.String(length=20),
|
|
server_default="Anonymous",
|
|
nullable=False,
|
|
),
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_column("games", "player_name")
|
|
# ### end Alembic commands ###
|