This commit is contained in:
2026-04-01 18:31:33 +02:00
parent 6e23e32bb0
commit b5c7c5305a
95 changed files with 9609 additions and 2374 deletions

View File

@@ -0,0 +1,48 @@
"""add_game_challenges_table
Revision ID: 29da7c818b01
Revises: a1b2c3d4e5f6
Create Date: 2026-03-28 23:20:21.949520
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '29da7c818b01'
down_revision: Union[str, Sequence[str], None] = 'a1b2c3d4e5f6'
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.create_table('game_challenges',
sa.Column('id', sa.UUID(), nullable=False),
sa.Column('challenger_id', sa.UUID(), nullable=False),
sa.Column('challenged_id', sa.UUID(), nullable=False),
sa.Column('challenger_deck_id', sa.UUID(), nullable=False),
sa.Column('status', sa.String(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.Column('expires_at', sa.DateTime(), nullable=False),
sa.ForeignKeyConstraint(['challenged_id'], ['users.id'], ),
sa.ForeignKeyConstraint(['challenger_deck_id'], ['decks.id'], ),
sa.ForeignKeyConstraint(['challenger_id'], ['users.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.drop_index(op.f('ix_trade_proposals_proposer_status'), table_name='trade_proposals')
op.drop_index(op.f('ix_trade_proposals_recipient_status'), table_name='trade_proposals')
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.create_index(op.f('ix_trade_proposals_recipient_status'), 'trade_proposals', ['recipient_id', 'status'], unique=False)
op.create_index(op.f('ix_trade_proposals_proposer_status'), 'trade_proposals', ['proposer_id', 'status'], unique=False)
op.drop_table('game_challenges')
# ### end Alembic commands ###