"""empty message

Revision ID: a53524410b9f
Revises: 8109d949f039
Create Date: 2019-12-03 13:53:09.995906

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a53524410b9f'
down_revision = '8109d949f039'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('possible_moves')
    op.add_column('list_possible_moves', sa.Column('game_id', sa.Unicode(), nullable=True))
    op.add_column('list_possible_moves', sa.Column('player_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'list_possible_moves', 'chess_game', ['game_id'], ['id'])
    op.create_foreign_key(None, 'list_possible_moves', 'player', ['player_id'], ['id'])
    op.drop_column('move', 'possible_moves_id')
    op.drop_column('move', 'possible_move_id')
    op.add_column('possible_move', sa.Column('list_id', sa.Integer(), nullable=True))
    op.drop_constraint(None, 'possible_move', type_='foreignkey')
    op.drop_constraint(None, 'possible_move', type_='foreignkey')
    op.create_foreign_key(None, 'possible_move', 'list_possible_moves', ['list_id'], ['id'])
    op.drop_column('possible_move', 'game_id')
    op.drop_column('possible_move', 'player_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('possible_move', sa.Column('player_id', sa.INTEGER(), nullable=True))
    op.add_column('possible_move', sa.Column('game_id', sa.VARCHAR(), nullable=True))
    op.drop_constraint(None, 'possible_move', type_='foreignkey')
    op.create_foreign_key(None, 'possible_move', 'player', ['player_id'], ['id'])
    op.create_foreign_key(None, 'possible_move', 'chess_game', ['game_id'], ['id'])
    op.drop_column('possible_move', 'list_id')
    op.add_column('move', sa.Column('possible_move_id', sa.VARCHAR(), nullable=True))
    op.add_column('move', sa.Column('possible_moves_id', sa.VARCHAR(), nullable=True))
    op.drop_constraint(None, 'list_possible_moves', type_='foreignkey')
    op.drop_constraint(None, 'list_possible_moves', type_='foreignkey')
    op.drop_column('list_possible_moves', 'player_id')
    op.drop_column('list_possible_moves', 'game_id')
    op.create_table('possible_moves',
    sa.Column('id', sa.VARCHAR(), nullable=False),
    sa.Column('player_id', sa.VARCHAR(), nullable=True),
    sa.ForeignKeyConstraint(['player_id'], ['player.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###
