"""empty message

Revision ID: cf4629169f43
Revises: d728826fe89a
Create Date: 2020-09-05 20:31:22.371739

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

# revision identifiers, used by Alembic.
revision = 'cf4629169f43'
down_revision = 'd728826fe89a'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('ratings2')
    op.create_index(op.f('ix_ratings_m_id'), 'ratings', ['m_id'], unique=False)
    op.create_index(op.f('ix_ratings_user_id'), 'ratings', ['user_id'], unique=False)
    op.drop_index('user_md5_UNIQUE', table_name='users')
    op.drop_column('users', 'user_md5')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('user_md5', mysql.VARCHAR(length=45), nullable=True))
    op.create_index('user_md5_UNIQUE', 'users', ['user_md5'], unique=True)
    op.drop_index(op.f('ix_ratings_user_id'), table_name='ratings')
    op.drop_index(op.f('ix_ratings_m_id'), table_name='ratings')
    op.create_table('ratings2',
    sa.Column('rating_id', mysql.BIGINT(display_width=20), autoincrement=False, nullable=True),
    sa.Column('user_md5', mysql.TEXT(), nullable=True),
    sa.Column('m_id', mysql.BIGINT(display_width=20), autoincrement=False, nullable=True),
    sa.Column('rating', mysql.BIGINT(display_width=20), autoincrement=False, nullable=True),
    sa.Column('rating_time', mysql.TEXT(), nullable=True),
    mysql_default_charset='utf8',
    mysql_engine='InnoDB'
    )
    # ### end Alembic commands ###
