"""Added BannerImage Table and StoreAddress Table

Revision ID: c1ffdaeef3ae
Revises: bcc08ae9bed7
Create Date: 2020-02-11 16:52:10.442005

"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils


# revision identifiers, used by Alembic.
revision = 'c1ffdaeef3ae'
down_revision = 'bcc08ae9bed7'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('banner_image',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('image', sa.String(length=300), nullable=False),
    sa.Column('caption', sa.String(length=300), nullable=True),
    sa.Column('active', sa.Boolean(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('store_address',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('address', sa.String(length=255), nullable=False),
    sa.Column('phone', sa.String(length=100), nullable=False),
    sa.Column('iframe', sa.Text(), nullable=False),
    sa.Column('opened', sa.Text(), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.drop_constraint('product_view_ibfk_2', 'product_view', type_='foreignkey')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_foreign_key('product_view_ibfk_2', 'product_view', 'product', ['client_ip'], ['id'])
    op.drop_table('store_address')
    op.drop_table('banner_image')
    # ### end Alembic commands ###
