"""adding playergame table

Revision ID: 7634640a0e6f
Revises: b63ee5702a33
Create Date: 2020-03-19 01:23:07.127083

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '7634640a0e6f'
down_revision = 'b63ee5702a33'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('player_game',
    sa.Column('player_id', sa.Integer(), nullable=False),
    sa.Column('game_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['game_id'], ['game.id'], ),
    sa.ForeignKeyConstraint(['player_id'], ['player.id'], ),
    sa.PrimaryKeyConstraint('player_id', 'game_id')
    )
    op.create_unique_constraint(None, 'game', ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'game', type_='unique')
    op.drop_table('player_game')
    # ### end Alembic commands ###
