"""copied_from column in card_models

Revision: 0011
Revision ID: 37d254b2a1bc
Revises: 3a5f18e53496
Create Date: 2015-06-18 01:19:51.087792

"""

# revision identifiers, used by Alembic.
revision = '37d254b2a1bc'
down_revision = '5a7dc5f0f913'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('card_models', sa.Column('copied_from_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'card_models', 'card_models', ['copied_from_id'], ['id'], ondelete='SET NULL')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'card_models', type_='foreignkey')
    op.drop_column('card_models', 'copied_from_id')
    ### end Alembic commands ###
