"""Add LID column to scores so we can track where a score was earned.

Revision ID: d041922684eb
Revises: 7e87f51ab94d
Create Date: 2018-01-21 20:13:25.210940

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'd041922684eb'
down_revision = '7e87f51ab94d'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('score', sa.Column('lid', sa.Integer(), nullable=False))
    op.create_index(op.f('ix_score_lid'), 'score', ['lid'], unique=False)
    op.add_column('score_history', sa.Column('lid', sa.Integer(), nullable=False))
    op.create_index(op.f('ix_score_history_lid'), 'score_history', ['lid'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_score_history_lid'), table_name='score_history')
    op.drop_column('score_history', 'lid')
    op.drop_index(op.f('ix_score_lid'), table_name='score')
    op.drop_column('score', 'lid')
    # ### end Alembic commands ###
