"""new film tables

Revision ID: d044f0a90c3f
Revises: 22d6e1af6064
Create Date: 2020-04-26 17:52:00.916940

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'd044f0a90c3f'
down_revision = '22d6e1af6064'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('film', sa.Column('actors', sa.String(), nullable=True))
    op.add_column('film', sa.Column('music_author', sa.String(), nullable=True))
    op.add_column('film', sa.Column('operator', sa.String(), nullable=True))
    op.add_column('film', sa.Column('producer', sa.String(), nullable=True))
    op.add_column('film', sa.Column('tags', sa.String(), nullable=True))
    op.add_column('film', sa.Column('writers', sa.String(), nullable=True))
    op.create_index(op.f('ix_film_actors'), 'film', ['actors'], unique=False)
    op.create_index(op.f('ix_film_music_author'), 'film', ['music_author'], unique=False)
    op.create_index(op.f('ix_film_operator'), 'film', ['operator'], unique=False)
    op.create_index(op.f('ix_film_producer'), 'film', ['producer'], unique=False)
    op.create_index(op.f('ix_film_tags'), 'film', ['tags'], unique=False)
    op.create_index(op.f('ix_film_writers'), 'film', ['writers'], unique=False)
    op.drop_column('film', 'film_page')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('film', sa.Column('film_page', sa.VARCHAR(), nullable=True))
    op.drop_index(op.f('ix_film_writers'), table_name='film')
    op.drop_index(op.f('ix_film_tags'), table_name='film')
    op.drop_index(op.f('ix_film_producer'), table_name='film')
    op.drop_index(op.f('ix_film_operator'), table_name='film')
    op.drop_index(op.f('ix_film_music_author'), table_name='film')
    op.drop_index(op.f('ix_film_actors'), table_name='film')
    op.drop_column('film', 'writers')
    op.drop_column('film', 'tags')
    op.drop_column('film', 'producer')
    op.drop_column('film', 'operator')
    op.drop_column('film', 'music_author')
    op.drop_column('film', 'actors')
    # ### end Alembic commands ###
