"""cmfdeal.primary_contact

Revision ID: 5ff490b853e0
Revises: b5cd0882d747
Create Date: 2021-04-16 10:39:47.613448

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5ff490b853e0'
down_revision = 'b5cd0882d747'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_deal', sa.Column('primary_contact_id', sa.String(length=64), nullable=True))
    op.create_index(op.f('ix_cmf_deal_primary_contact_id'), 'cmf_deal', ['primary_contact_id'], unique=False)
    op.create_foreign_key(None, 'cmf_deal', 'cmf_person', ['primary_contact_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'cmf_deal', type_='foreignkey')
    op.drop_index(op.f('ix_cmf_deal_primary_contact_id'), table_name='cmf_deal')
    op.drop_column('cmf_deal', 'primary_contact_id')
    # ### end Alembic commands ###
