"""empty message

Revision ID: 31ea09cc95f0
Revises: 226a309623db
Create Date: 2021-06-28 18:59:27.118176

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

# revision identifiers, used by Alembic.
revision = '31ea09cc95f0'
down_revision = '226a309623db'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('request', schema=None) as batch_op:
        batch_op.add_column(sa.Column('paid', sa.Boolean(), nullable=True))
        batch_op.drop_constraint('request_ibfk_3', type_='foreignkey')
        batch_op.drop_constraint('request_ibfk_1', type_='foreignkey')
        batch_op.drop_column('counselor_foreignkey')
        batch_op.drop_column('state_foreignkey')

    with op.batch_alter_table('respond', schema=None) as batch_op:
        batch_op.drop_constraint('respond_ibfk_1', type_='foreignkey')
        batch_op.drop_column('counselor_foreignkey')

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('respond', schema=None) as batch_op:
        batch_op.add_column(sa.Column('counselor_foreignkey', mysql.INTEGER(), autoincrement=False, nullable=True))
        batch_op.create_foreign_key('respond_ibfk_1', 'counselor', ['counselor_foreignkey'], ['id'])

    with op.batch_alter_table('request', schema=None) as batch_op:
        batch_op.add_column(sa.Column('state_foreignkey', mysql.INTEGER(), autoincrement=False, nullable=True))
        batch_op.add_column(sa.Column('counselor_foreignkey', mysql.INTEGER(), autoincrement=False, nullable=True))
        batch_op.create_foreign_key('request_ibfk_1', 'counselor', ['counselor_foreignkey'], ['id'])
        batch_op.create_foreign_key('request_ibfk_3', 'state', ['state_foreignkey'], ['id'])
        batch_op.drop_column('paid')

    # ### end Alembic commands ###
