"""empty message

Revision ID: 57469fc189cb
Revises: 2cc88a062410
Create Date: 2018-08-13 00:47:51.955870

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '57469fc189cb'
down_revision = '2cc88a062410'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('restaurant_chain',
    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('restaurant_chain_name', sa.String(), nullable=True),
    sa.Column('restaurant_chain_category', sa.Integer(), nullable=True),
    sa.Column('restaurant_chain_desc', sa.Text(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_restaurant_chain_id'), 'restaurant_chain', ['id'], unique=False)
    op.create_table('hotel_collection',
    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('hotel_id', sa.Integer(), nullable=True),
    sa.Column('collection_name', sa.String(), nullable=True),
    sa.Column('featured', sa.Boolean(), nullable=True),
    sa.Column('desc', sa.Text(), nullable=True),
    sa.Column('image', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['hotel_id'], ['hotel.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('hotel_id')
    )
    op.create_index(op.f('ix_hotel_collection_id'), 'hotel_collection', ['id'], unique=False)
    op.create_table('collection_product',
    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('hotel_collection_id', sa.Integer(), nullable=False),
    sa.Column('product_url', sa.String(), nullable=True),
    sa.Column('product_name', sa.String(), nullable=True),
    sa.Column('featured_product', sa.Boolean(), nullable=True),
    sa.Column('product_desc', sa.Text(), nullable=True),
    sa.Column('product_image', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['hotel_collection_id'], ['hotel_collection.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_collection_product_id'), 'collection_product', ['id'], unique=False)
    op.add_column('restaurant', sa.Column('break_interval', sa.Integer(), nullable=True))
    op.add_column('restaurant', sa.Column('break_time', sa.TIME(), nullable=True))
    op.add_column('restaurant', sa.Column('closing_time', sa.TIME(), nullable=True))
    op.add_column('restaurant', sa.Column('mode_of_payment', sa.Integer(), nullable=True))
    op.add_column('restaurant', sa.Column('off_day_in_week', sa.String(), nullable=True))
    op.add_column('restaurant', sa.Column('opening_time', sa.TIME(), nullable=True))
    op.add_column('restaurant', sa.Column('restaurant_chain_id', sa.Integer(), nullable=True))
    op.add_column('restaurant', sa.Column('state', sa.String(), nullable=True))
    op.create_foreign_key(None, 'restaurant', 'restaurant_chain', ['restaurant_chain_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'restaurant', type_='foreignkey')
    op.drop_column('restaurant', 'state')
    op.drop_column('restaurant', 'restaurant_chain_id')
    op.drop_column('restaurant', 'opening_time')
    op.drop_column('restaurant', 'off_day_in_week')
    op.drop_column('restaurant', 'mode_of_payment')
    op.drop_column('restaurant', 'closing_time')
    op.drop_column('restaurant', 'break_time')
    op.drop_column('restaurant', 'break_interval')
    op.drop_index(op.f('ix_collection_product_id'), table_name='collection_product')
    op.drop_table('collection_product')
    op.drop_index(op.f('ix_hotel_collection_id'), table_name='hotel_collection')
    op.drop_table('hotel_collection')
    op.drop_index(op.f('ix_restaurant_chain_id'), table_name='restaurant_chain')
    op.drop_table('restaurant_chain')
    # ### end Alembic commands ###
