"""empty message

Revision ID: 43cfdf0f229c
Revises: 9a5aa55437fd
Create Date: 2018-08-03 19:05:01.700555

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '43cfdf0f229c'
down_revision = '9a5aa55437fd'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cab_deal_association',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(timezone=True), nullable=True),
    sa.Column('updated_at', sa.DateTime(timezone=True), nullable=True),
    sa.Column('cab_id', sa.Integer(), nullable=True),
    sa.Column('deal_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['cab_id'], ['cab.id'], ),
    sa.ForeignKeyConstraint(['deal_id'], ['cab_deal.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cab_deal_association_id'), 'cab_deal_association', ['id'], unique=False)
    op.drop_constraint('cab_booking_cab_id_fkey', 'cab_booking', type_='foreignkey')
    op.drop_column('cab_booking', 'cab_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cab_booking', sa.Column('cab_id', sa.INTEGER(), autoincrement=False, nullable=True))
    op.create_foreign_key('cab_booking_cab_id_fkey', 'cab_booking', 'cab', ['cab_id'], ['id'])
    op.drop_index(op.f('ix_cab_deal_association_id'), table_name='cab_deal_association')
    op.drop_table('cab_deal_association')
    # ### end Alembic commands ###
