"""Add catalog table.

Revision ID: 38ad3e2db188
Revises: 2a3ebcd7d840
Create Date: 2017-07-20 19:36:46.537670

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '38ad3e2db188'
down_revision = '2a3ebcd7d840'
branch_labels = None
depends_on = None


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


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