"""Add region column to arcade settings.

Revision ID: a1f4a09a1f90
Revises: 36dff3ac15a3
Create Date: 2021-09-06 22:01:29.905538

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import text


# revision identifiers, used by Alembic.
revision = 'a1f4a09a1f90'
down_revision = '36dff3ac15a3'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('arcade', sa.Column('pref', sa.Integer(), nullable=False))
    # ### end Alembic commands ###

    conn = op.get_bind()

    # Set a sane default for all current arcades.
    sql = "UPDATE arcade SET pref = 56"
    conn.execute(text(sql), {})


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('arcade', 'pref')
    # ### end Alembic commands ###
