"""empty message

Revision ID: b86b2b5383f0
Revises: 6cda2faa2503
Create Date: 2018-07-11 09:14:25.890038

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = 'b86b2b5383f0'
down_revision = '6cda2faa2503'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('accImage_id', table_name='accommodationimage')
    op.drop_table('accommodationimage')
    op.add_column('accommodation', sa.Column('acc_county', sa.Integer(), nullable=True))
    op.add_column('accommodation', sa.Column('acc_images', sa.Text(), nullable=True))
    op.add_column('accommodation', sa.Column('acc_street', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'accommodation', 'county', ['acc_county'], ['county_id'])
    op.create_foreign_key(None, 'accommodation', 'street', ['acc_street'], ['street_id'])
    op.add_column('user', sa.Column('headico', sa.String(length=100), nullable=True))
    op.drop_column('user', 'address')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user', sa.Column('address', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=100), nullable=True))
    op.drop_column('user', 'headico')
    op.drop_constraint(None, 'accommodation', type_='foreignkey')
    op.drop_constraint(None, 'accommodation', type_='foreignkey')
    op.drop_column('accommodation', 'acc_street')
    op.drop_column('accommodation', 'acc_images')
    op.drop_column('accommodation', 'acc_county')
    op.create_table('accommodationimage',
    sa.Column('accImage_id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
    sa.Column('accImage_acc_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
    sa.Column('accImage_url', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255), nullable=True),
    sa.ForeignKeyConstraint(['accImage_acc_id'], ['accommodation.acc_id'], name='accommodationimage_ibfk_1'),
    sa.PrimaryKeyConstraint('accImage_id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('accImage_id', 'accommodationimage', ['accImage_id'], unique=True)
    # ### end Alembic commands ###
