"""empty message

Revision ID: 4df44fc640f1
Revises: e0fe944d0566
Create Date: 2021-03-31 16:38:59.871907

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

# revision identifiers, used by Alembic.
revision = '4df44fc640f1'
down_revision = 'e0fe944d0566'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('favorite', sa.Column('user_id', sa.Integer(), nullable=True))
    op.add_column('favorite', sa.Column('username', sa.String(length=250), nullable=True))
    op.drop_constraint('favorite_ibfk_1', 'favorite', type_='foreignkey')
    op.create_foreign_key(None, 'favorite', 'user', ['user_id'], ['id'])
    op.drop_column('favorite', 'users_id')
    op.drop_column('favorite', 'name')
    op.add_column('user', sa.Column('username', sa.String(length=250), nullable=False))
    op.drop_column('user', 'name')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user', sa.Column('name', mysql.VARCHAR(length=250), nullable=False))
    op.drop_column('user', 'username')
    op.add_column('favorite', sa.Column('name', mysql.VARCHAR(length=250), nullable=True))
    op.add_column('favorite', sa.Column('users_id', mysql.INTEGER(), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'favorite', type_='foreignkey')
    op.create_foreign_key('favorite_ibfk_1', 'favorite', 'user', ['users_id'], ['id'])
    op.drop_column('favorite', 'username')
    op.drop_column('favorite', 'user_id')
    # ### end Alembic commands ###
