"""fix_foreign_key

Revision: 0076
Revision ID: 3610446b33b5
Revises: 1f8b6ec9e38a
Create Date: 2016-11-07 18:03:31.222747

"""

# revision identifiers, used by Alembic.
revision = '3610446b33b5'
down_revision = '1f8b6ec9e38a'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.drop_constraint(op.f('cards_state_alias_id_fkey'), 'cards', type_='foreignkey')
    op.create_foreign_key(None, 'cards', 'card_groups', ['state_alias_id'], ['id'], ondelete='SET NULL')


def downgrade():
    pass
