"""BigInteger for UserID so we can store virtual IDs (cards).

Revision ID: 25e9f367b137
Revises: d02f0bf59400
Create Date: 2018-02-18 22:42:11.013666

"""
from alembic import op
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = '25e9f367b137'
down_revision = 'd02f0bf59400'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('arcade_owner', 'userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=False)
    op.alter_column('audit', 'userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=True)
    op.alter_column('balance', 'userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=False)
    op.alter_column('card', 'userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=False)
    op.alter_column('extid', 'userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=False)
    op.alter_column('game_settings', 'userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=False)
    op.alter_column('link', 'other_userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=False)
    op.alter_column('link', 'userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=False)
    op.alter_column('lobby', 'userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=False)
    op.alter_column('playsession', 'userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=False)
    op.alter_column('refid', 'userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=False)
    op.alter_column('score', 'userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=False)
    op.alter_column('score_history', 'userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=False)
    op.alter_column('series_achievement', 'userid',
               existing_type=mysql.INTEGER(display_width=11),
               type_=mysql.BIGINT(unsigned=True),
               existing_nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('series_achievement', 'userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=False)
    op.alter_column('score_history', 'userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=False)
    op.alter_column('score', 'userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=False)
    op.alter_column('refid', 'userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=False)
    op.alter_column('playsession', 'userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=False)
    op.alter_column('lobby', 'userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=False)
    op.alter_column('link', 'userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=False)
    op.alter_column('link', 'other_userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=False)
    op.alter_column('game_settings', 'userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=False)
    op.alter_column('extid', 'userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=False)
    op.alter_column('card', 'userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=False)
    op.alter_column('balance', 'userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=False)
    op.alter_column('audit', 'userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=True)
    op.alter_column('arcade_owner', 'userid',
               existing_type=mysql.BIGINT(unsigned=True),
               type_=mysql.INTEGER(display_width=11),
               existing_nullable=False)
    # ### end Alembic commands ###
