"""empty message

Revision ID: f8e6611d86cd
Revises: 
Create Date: 2021-08-05 17:22:41.821194

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('NFL',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('AFC', sa.BOOLEAN(), nullable=True),
    sa.Column('division', sa.VARCHAR(length=5), nullable=True),
    sa.Column('name', sa.VARCHAR(length=30), nullable=True),
    sa.Column('abbr', sa.VARCHAR(length=3), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(), nullable=True),
    sa.Column('full_name', sa.String(), nullable=True),
    sa.Column('email', sa.String(), nullable=True),
    sa.Column('hashed_password', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('leagues',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('idp', sa.Boolean(), nullable=True),
    sa.Column('name', sa.String(length=75), nullable=True),
    sa.Column('hashed password', sa.String(length=255), nullable=True),
    sa.Column('conference', sa.Boolean(), nullable=True),
    sa.Column('division', sa.Integer(), nullable=True),
    sa.Column('max_roster', sa.Integer(), nullable=True),
    sa.Column('userId', sa.Integer(), nullable=True),
    sa.Column('commissioner', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['userId'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('posts',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('title', sa.VARCHAR(length=50), nullable=True),
    sa.Column('body', sa.Text(), nullable=True),
    sa.Column('created_at', sa.Date(), nullable=True),
    sa.Column('userId', sa.Integer(), nullable=True),
    sa.Column('leagueId', sa.Integer(), nullable=True),
    sa.Column('index', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['leagueId'], ['leagues.id'], ),
    sa.ForeignKeyConstraint(['userId'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('roster_position_settings',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('leagueId', sa.Integer(), nullable=True),
    sa.Column('position', sa.VARCHAR(length=3), nullable=True),
    sa.Column('min_start', sa.Integer(), nullable=True),
    sa.Column('max_start', sa.Integer(), nullable=True),
    sa.Column('min_rost', sa.Integer(), nullable=True),
    sa.Column('max_rost', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['leagueId'], ['leagues.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('rosters',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=True),
    sa.Column('leagueId', sa.Integer(), nullable=True),
    sa.Column('userId', sa.Integer(), nullable=True),
    sa.Column('proj_pts', sa.Integer(), nullable=True),
    sa.Column('seas_pts', sa.Integer(), nullable=True),
    sa.Column('abbr', sa.VARCHAR(length=5), nullable=True),
    sa.ForeignKeyConstraint(['leagueId'], ['leagues.id'], ),
    sa.ForeignKeyConstraint(['userId'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('comments',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('body', sa.Text(), nullable=True),
    sa.Column('created_at', sa.Date(), nullable=True),
    sa.Column('postId', sa.Integer(), nullable=True),
    sa.Column('userId', sa.Integer(), nullable=True),
    sa.Column('index', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['postId'], ['posts.id'], ),
    sa.ForeignKeyConstraint(['userId'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('players',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('firstName', sa.String(length=50), nullable=True),
    sa.Column('lastName', sa.String(length=50), nullable=True),
    sa.Column('position', sa.String(length=3), nullable=True),
    sa.Column('age', sa.Integer(), nullable=True),
    sa.Column('NFL_Team', sa.Integer(), nullable=True),
    sa.Column('seasons', sa.Integer(), nullable=True),
    sa.Column('status', sa.VARCHAR(length=3), nullable=True),
    sa.Column('current_season_pts', sa.Integer(), nullable=True),
    sa.Column('career_pts', sa.Integer(), nullable=True),
    sa.Column('projected_pts', sa.Integer(), nullable=True),
    sa.Column('rosterId', sa.Integer(), nullable=True),
    sa.Column('leagueId', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['NFL_Team'], ['NFL.id'], ),
    sa.ForeignKeyConstraint(['leagueId'], ['leagues.id'], ),
    sa.ForeignKeyConstraint(['rosterId'], ['rosters.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('schedule',
    sa.Column('week', sa.Integer(), nullable=False),
    sa.Column('leagueId', sa.Integer(), nullable=False),
    sa.Column('home_roster_id', sa.Integer(), nullable=False),
    sa.Column('away_roster_id', sa.Integer(), nullable=True),
    sa.Column('home_score', sa.Integer(), nullable=True),
    sa.Column('away_score', sa.Integer(), nullable=True),
    sa.Column('home_wins', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['away_roster_id'], ['rosters.id'], ),
    sa.ForeignKeyConstraint(['home_roster_id'], ['rosters.id'], ),
    sa.ForeignKeyConstraint(['leagueId'], ['leagues.id'], ),
    sa.PrimaryKeyConstraint('week', 'leagueId', 'home_roster_id')
    )
    op.create_table('players_leagues',
    sa.Column('playerId', sa.Integer(), nullable=False),
    sa.Column('leagueId', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['leagueId'], ['leagues.id'], ),
    sa.ForeignKeyConstraint(['playerId'], ['players.id'], ),
    sa.PrimaryKeyConstraint('playerId', 'leagueId')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('players_leagues')
    op.drop_table('schedule')
    op.drop_table('players')
    op.drop_table('comments')
    op.drop_table('rosters')
    op.drop_table('roster_position_settings')
    op.drop_table('posts')
    op.drop_table('leagues')
    op.drop_table('users')
    op.drop_table('NFL')
    # ### end Alembic commands ###
