"""Add time-sensitive game settings table.

Revision ID: 26dcace5d5d4
Revises: d764dd3489e6
Create Date: 2016-12-22 20:31:22.574245

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '26dcace5d5d4'
down_revision = 'd764dd3489e6'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('time_sensitive_settings',
    sa.Column('game', sa.String(length=32), nullable=False),
    sa.Column('version', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=32), nullable=False),
    sa.Column('start_time', sa.Integer(), nullable=False),
    sa.Column('end_time', sa.Integer(), nullable=False),
    sa.Column('data', sa.JSON(), nullable=False),
    sa.UniqueConstraint('game', 'version', 'name', 'start_time', name='game_version_name_start_time'),
    mysql_charset='utf8mb4'
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('time_sensitive_settings')
    # ### end Alembic commands ###
