"""remove mtgjson foreign key constraint

Revision ID: 2025_04_14_remove_mtgjson_foreign_key
Revises: 2025_04_14_remove_mtgjson_data_columns
Create Date: 2025-04-14 00:00:00.000000

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = '2025_04_14_remove_mtgjson_foreign_key'
down_revision = '2025_04_14_remove_mtgjson_data_columns'
branch_labels = None
depends_on = None


def upgrade() -> None:
    # Drop the foreign key constraint from mtgjson_skus table
    op.drop_constraint('mtgjson_skus_card_id_fkey', 'mtgjson_skus', type_='foreignkey')


def downgrade() -> None:
    # Recreate the foreign key constraint
    op.create_foreign_key(
        'mtgjson_skus_card_id_fkey',
        'mtgjson_skus',
        'mtgjson_cards',
        ['card_id'],
        ['card_id']
    ) 