"""create cfg_category_range_mapping table

Revision ID: bc0fab3363f7
Revises: 960676c435b2
Create Date: 2017-08-12 23:11:42.385100

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'bc0fab3363f7'
down_revision = '960676c435b2'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cfg_category_range_mapping',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('category', sa.String(length=255), nullable=False),
    sa.Column('range_min', sa.Integer(unsigned=True), nullable=False),
    sa.Column('range_max', sa.Integer(unsigned=True), nullable=False),
    sa.Column('current', sa.Integer(unsigned=True), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('category')
    )
    op.create_index(u'ix_cfg_category_range_mapping_current', 'cfg_category_range_mapping', ['current'], unique=False)
    op.create_index(u'ix_cfg_category_range_mapping_range_max', 'cfg_category_range_mapping', ['range_max'], unique=False)
    op.create_index(u'ix_cfg_category_range_mapping_range_min', 'cfg_category_range_mapping', ['range_min'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(u'ix_cfg_category_range_mapping_range_min', table_name='cfg_category_range_mapping')
    op.drop_index(u'ix_cfg_category_range_mapping_range_max', table_name='cfg_category_range_mapping')
    op.drop_index(u'ix_cfg_category_range_mapping_current', table_name='cfg_category_range_mapping')
    op.drop_table('cfg_category_range_mapping')
    # ### end Alembic commands ###
