"""teams table

Revision ID: d246944786cd
Revises: 
Create Date: 2018-08-06 16:24:38.831259

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('team',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=150), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('player',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('real_name', sa.String(length=250), nullable=True),
    sa.Column('gamer_tag', sa.String(length=250), nullable=True),
    sa.Column('exp_points', sa.Integer(), nullable=True),
    sa.Column('team_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['team_id'], ['team.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_player_gamer_tag'), 'player', ['gamer_tag'], unique=False)
    op.create_index(op.f('ix_player_real_name'), 'player', ['real_name'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_player_real_name'), table_name='player')
    op.drop_index(op.f('ix_player_gamer_tag'), table_name='player')
    op.drop_table('player')
    op.drop_table('team')
    # ### end Alembic commands ###
