- Add widget token authentication system - Create leaderboard, current assignment, and progress widgets - Support dark, light, and neon themes - Add widget settings modal for URL generation - Fix avatar loading through backend API proxy 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
"""Add widget tokens
|
|
|
|
Revision ID: 029
|
|
Revises: 028
|
|
Create Date: 2025-01-09
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision = '029_add_widget_tokens'
|
|
down_revision = '028_add_promo_codes'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
op.create_table(
|
|
'widget_tokens',
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
|
sa.Column('token', sa.String(64), nullable=False),
|
|
sa.Column('participant_id', sa.Integer(), nullable=False),
|
|
sa.Column('marathon_id', sa.Integer(), nullable=False),
|
|
sa.Column('created_at', sa.DateTime(), nullable=False),
|
|
sa.Column('expires_at', sa.DateTime(), nullable=True),
|
|
sa.Column('is_active', sa.Boolean(), nullable=False, server_default='true'),
|
|
sa.PrimaryKeyConstraint('id'),
|
|
sa.ForeignKeyConstraint(['participant_id'], ['participants.id'], ondelete='CASCADE'),
|
|
sa.ForeignKeyConstraint(['marathon_id'], ['marathons.id'], ondelete='CASCADE'),
|
|
)
|
|
op.create_index('ix_widget_tokens_token', 'widget_tokens', ['token'], unique=True)
|
|
|
|
|
|
def downgrade():
|
|
op.drop_index('ix_widget_tokens_token', table_name='widget_tokens')
|
|
op.drop_table('widget_tokens')
|