"""Allow multiple owners of arcades.

Revision ID: 691d49925c52
Revises: afd66ee7c0e0
Create Date: 2016-12-07 17:00:19.943809

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

# revision identifiers, used by Alembic.
revision = '691d49925c52'
down_revision = 'afd66ee7c0e0'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('arcade_owner',
    sa.Column('userid', sa.Integer(), nullable=False),
    sa.Column('arcadeid', sa.Integer(), nullable=False),
    sa.UniqueConstraint('userid', 'arcadeid', name='userid_arcadeid'),
    mysql_charset='utf8mb4'
    )
    op.drop_column('arcade', 'userid')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('arcade', sa.Column('userid', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
    op.drop_table('arcade_owner')
    # ### end Alembic commands ###
