"""updated init to actually include files

Revision ID: 6396a5a61194
Revises: 17776169982d
Create Date: 2026-01-05 16:40:57.576147

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '6396a5a61194'
down_revision: Union[str, Sequence[str], None] = '17776169982d'
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('raw_cards',
    sa.Column('id', sa.String(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('collect_number', sa.Integer(), nullable=False),
    sa.Column('rarity', sa.Enum('COMMON', 'UNCOMMON', 'RARE', name='rarity'), nullable=False),
    sa.Column('image_path', sa.String(), nullable=False),
    sa.Column('flavor_text', sa.String(), nullable=True),
    sa.Column('amount_pulled', sa.Integer(), nullable=True),
    sa.Column('card_type', sa.String(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('decks',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.BigInteger(), nullable=True),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('is_active', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.user_id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('raw_action_cards',
    sa.Column('id', sa.String(), nullable=False),
    sa.Column('action_card_type', sa.Enum('INSTANT', 'EQUIPMENT', name='actioncardtype'), nullable=False),
    sa.Column('mana_cost', sa.JSON(), nullable=True),
    sa.Column('effect_text', sa.String(), nullable=True),
    sa.Column('effect_code', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['id'], ['raw_cards.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('raw_character_cards',
    sa.Column('id', sa.String(), nullable=False),
    sa.Column('total_energy', sa.Integer(), nullable=False),
    sa.Column('mana_type', sa.Enum('MUSIC', 'ART', 'PROGRAMMING', 'DESIGN', 'ANY', name='manatype'), nullable=False),
    sa.ForeignKeyConstraint(['id'], ['raw_cards.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('raw_location_cards',
    sa.Column('id', sa.String(), nullable=False),
    sa.Column('mana_cost', sa.JSON(), nullable=True),
    sa.Column('effect_text', sa.String(), nullable=True),
    sa.Column('effect_code', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['id'], ['raw_cards.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('raw_moves',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('card_id', sa.String(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('mana_cost', sa.JSON(), nullable=False),
    sa.Column('effect_text', sa.String(), nullable=False),
    sa.Column('effect_code', sa.String(), nullable=False),
    sa.ForeignKeyConstraint(['card_id'], ['raw_cards.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user_cards',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.BigInteger(), nullable=False),
    sa.Column('raw_card_id', sa.String(), nullable=False),
    sa.Column('pull_number', sa.Integer(), nullable=False),
    sa.Column('modifiers', sa.JSON(), nullable=True),
    sa.Column('obtained_at', sa.DateTime(), nullable=False),
    sa.ForeignKeyConstraint(['raw_card_id'], ['raw_cards.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.user_id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('deck_cards',
    sa.Column('deck_id', sa.Integer(), nullable=False),
    sa.Column('user_card_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['deck_id'], ['decks.id'], ),
    sa.ForeignKeyConstraint(['user_card_id'], ['user_cards.id'], ),
    sa.PrimaryKeyConstraint('deck_id', 'user_card_id')
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('deck_cards')
    op.drop_table('user_cards')
    op.drop_table('raw_moves')
    op.drop_table('raw_location_cards')
    op.drop_table('raw_character_cards')
    op.drop_table('raw_action_cards')
    op.drop_table('decks')
    op.drop_table('raw_cards')
    # ### end Alembic commands ###
