"""empty message

Revision ID: 5e7f7152b2d5
Revises: b2eb3d6db1bd
Create Date: 2018-10-06 22:49:10.658024

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '5e7f7152b2d5'
down_revision = 'b2eb3d6db1bd'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('hotel', sa.Column('collection_id', sa.Integer(), nullable=True))
    op.create_unique_constraint(None, 'hotel', ['collection_id'])
    op.create_foreign_key(None, 'hotel', 'collection', ['collection_id'], ['id'])
    op.drop_constraint('hotel_collection_hotel_id_key', 'hotel_collection', type_='unique')
    op.drop_constraint('hotel_collection_hotel_id_fkey', 'hotel_collection', type_='foreignkey')
    op.drop_column('hotel_collection', 'hotel_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('hotel_collection', sa.Column('hotel_id', sa.INTEGER(), autoincrement=False, nullable=True))
    op.create_foreign_key('hotel_collection_hotel_id_fkey', 'hotel_collection', 'hotel', ['hotel_id'], ['id'])
    op.create_unique_constraint('hotel_collection_hotel_id_key', 'hotel_collection', ['hotel_id'])
    op.drop_constraint(None, 'hotel', type_='foreignkey')
    op.drop_constraint(None, 'hotel', type_='unique')
    op.drop_column('hotel', 'collection_id')
    # ### end Alembic commands ###
