"""список киношек

Revision ID: 93e6aad987bc
Revises: 43ff49e81804
Create Date: 2020-05-31 15:17:42.332885

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '93e6aad987bc'
down_revision = '43ff49e81804'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('session_cinema')
    op.drop_table('session')
    op.drop_table('cinema')
    op.add_column('tag', sa.Column('location1', sa.String(length=200), nullable=True))
    op.add_column('tag', sa.Column('location2', sa.String(length=200), nullable=True))
    op.add_column('tag', sa.Column('name1', sa.String(length=100), nullable=True))
    op.add_column('tag', sa.Column('name2', sa.String(length=100), nullable=True))
    op.add_column('tag', sa.Column('time1', sa.String(length=100), nullable=True))
    op.add_column('tag', sa.Column('time2', sa.String(length=100), nullable=True))
    op.drop_column('tag', 'name')
    op.drop_column('tag', 'location')
    op.drop_column('tag', 'time')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('tag', sa.Column('time', sa.VARCHAR(length=100), nullable=True))
    op.add_column('tag', sa.Column('location', sa.VARCHAR(length=200), nullable=True))
    op.add_column('tag', sa.Column('name', sa.VARCHAR(length=100), nullable=True))
    op.drop_column('tag', 'time2')
    op.drop_column('tag', 'time1')
    op.drop_column('tag', 'name2')
    op.drop_column('tag', 'name1')
    op.drop_column('tag', 'location2')
    op.drop_column('tag', 'location1')
    op.create_table('cinema',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('name', sa.VARCHAR(length=300), nullable=True),
    sa.Column('location', sa.VARCHAR(length=500), nullable=True),
    sa.Column('days_work', sa.VARCHAR(length=300), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('session',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('time', sa.VARCHAR(length=100), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('session_cinema',
    sa.Column('cinema_id', sa.INTEGER(), nullable=True),
    sa.Column('session_id', sa.INTEGER(), nullable=True),
    sa.Column('time', sa.VARCHAR(), nullable=True),
    sa.ForeignKeyConstraint(['cinema_id'], ['cinema.id'], ),
    sa.ForeignKeyConstraint(['session_id'], ['session.id'], )
    )
    # ### end Alembic commands ###
