"""delete post

Revision ID: 827fe25743be
Revises: da8512962f69
Create Date: 2018-05-25 16:16:55.862396

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '827fe25743be'
down_revision = 'da8512962f69'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_post_timestamp', table_name='post')
    op.drop_index('ix_post_userRating', table_name='post')
    op.drop_index('ix_post_year', table_name='post')
    op.drop_table('post')
    op.add_column('user_film', sa.Column('userRating', sa.Integer(), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('user_film', 'userRating')
    op.create_table('post',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('title', sa.VARCHAR(length=255), nullable=True),
    sa.Column('year', sa.String(64), nullable=True),
    sa.Column('genres', sa.VARCHAR(length=255), nullable=True),
    sa.Column('userRating', sa.INTEGER(), nullable=True),
    sa.Column('timestamp', sa.DATETIME(), nullable=True),
    sa.Column('user_id', sa.INTEGER(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index('ix_post_year', 'post', ['year'], unique=False)
    op.create_index('ix_post_userRating', 'post', ['userRating'], unique=False)
    op.create_index('ix_post_timestamp', 'post', ['timestamp'], unique=False)
    # ### end Alembic commands ###
