"""empty message

Revision ID: 51aa6c06c13a
Revises: 
Create Date: 2018-10-23 13:39:49.656359

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

# revision identifiers, used by Alembic.
revision = '51aa6c06c13a'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('tbl_sales_os_count_stu')
    op.drop_table('tbl_sales_ram_count_stu')
    op.drop_table('tbl_sales_rom_count')
    op.drop_table('tbl_sales_ram_count')
    op.drop_table('tbl_sales_cpu_count')
    op.drop_table('tbl_sales_os_count')
    op.drop_table('tbl_sales_rom_count_stu')
    op.drop_table('tbl_sales_cpu_count_stu')
    op.alter_column('tbl_sales_cpu_count_pro', 'fld_cpu_name',
               existing_type=mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255),
               nullable=True)
    op.alter_column('tbl_sales_cpu_count_pro', 'fld_sale_count',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=True)
    op.create_unique_constraint(None, 'tbl_sales_cpu_count_pro', ['fld_cpu_name'])
    op.create_unique_constraint(None, 'tbl_sales_cpu_count_pro', ['fld_sale_count'])
    op.alter_column('tbl_sales_os_count_pro', 'fld_os_name',
               existing_type=mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255),
               nullable=True)
    op.alter_column('tbl_sales_os_count_pro', 'fld_sale_count',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=True)
    op.create_unique_constraint(None, 'tbl_sales_os_count_pro', ['fld_sale_count'])
    op.create_unique_constraint(None, 'tbl_sales_os_count_pro', ['fld_os_name'])
    op.alter_column('tbl_sales_ram_count_pro', 'fld_ram_name',
               existing_type=mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255),
               nullable=True)
    op.alter_column('tbl_sales_ram_count_pro', 'fld_sale_count',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=True)
    op.create_unique_constraint(None, 'tbl_sales_ram_count_pro', ['fld_ram_name'])
    op.create_unique_constraint(None, 'tbl_sales_ram_count_pro', ['fld_sale_count'])
    op.alter_column('tbl_sales_rom_count_pro', 'fld_rom_name',
               existing_type=mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255),
               nullable=True)
    op.alter_column('tbl_sales_rom_count_pro', 'fld_sale_count',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=True)
    op.create_unique_constraint(None, 'tbl_sales_rom_count_pro', ['fld_sale_count'])
    op.create_unique_constraint(None, 'tbl_sales_rom_count_pro', ['fld_rom_name'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'tbl_sales_rom_count_pro', type_='unique')
    op.drop_constraint(None, 'tbl_sales_rom_count_pro', type_='unique')
    op.alter_column('tbl_sales_rom_count_pro', 'fld_sale_count',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=False)
    op.alter_column('tbl_sales_rom_count_pro', 'fld_rom_name',
               existing_type=mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255),
               nullable=False)
    op.drop_constraint(None, 'tbl_sales_ram_count_pro', type_='unique')
    op.drop_constraint(None, 'tbl_sales_ram_count_pro', type_='unique')
    op.alter_column('tbl_sales_ram_count_pro', 'fld_sale_count',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=False)
    op.alter_column('tbl_sales_ram_count_pro', 'fld_ram_name',
               existing_type=mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255),
               nullable=False)
    op.drop_constraint(None, 'tbl_sales_os_count_pro', type_='unique')
    op.drop_constraint(None, 'tbl_sales_os_count_pro', type_='unique')
    op.alter_column('tbl_sales_os_count_pro', 'fld_sale_count',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=False)
    op.alter_column('tbl_sales_os_count_pro', 'fld_os_name',
               existing_type=mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255),
               nullable=False)
    op.drop_constraint(None, 'tbl_sales_cpu_count_pro', type_='unique')
    op.drop_constraint(None, 'tbl_sales_cpu_count_pro', type_='unique')
    op.alter_column('tbl_sales_cpu_count_pro', 'fld_sale_count',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=False)
    op.alter_column('tbl_sales_cpu_count_pro', 'fld_cpu_name',
               existing_type=mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255),
               nullable=False)
    op.create_table('tbl_sales_cpu_count_stu',
    sa.Column('fld_index', mysql.INTEGER(display_width=11), nullable=False),
    sa.Column('fld_cpu_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255), nullable=False),
    sa.Column('fld_sale_count', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('fld_index'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('tbl_sales_rom_count_stu',
    sa.Column('fld_index', mysql.INTEGER(display_width=11), nullable=False),
    sa.Column('fld_rom_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255), nullable=False),
    sa.Column('fld_sale_count', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('fld_index'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('tbl_sales_os_count',
    sa.Column('fld_os_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255), nullable=False),
    sa.Column('fld_sale_count', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('tbl_sales_cpu_count',
    sa.Column('fld_cpu_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255), nullable=False),
    sa.Column('fld_sale_count', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('tbl_sales_ram_count',
    sa.Column('fld_ram_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255), nullable=False),
    sa.Column('fld_sale_count', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('tbl_sales_rom_count',
    sa.Column('fld_rom_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255), nullable=False),
    sa.Column('fld_sale_count', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('tbl_sales_ram_count_stu',
    sa.Column('fld_index', mysql.INTEGER(display_width=11), nullable=False),
    sa.Column('fld_ram_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255), nullable=False),
    sa.Column('fld_sale_count', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('fld_index'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_table('tbl_sales_os_count_stu',
    sa.Column('fld_index', mysql.INTEGER(display_width=11), nullable=False),
    sa.Column('fld_os_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=255), nullable=False),
    sa.Column('fld_sale_count', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('fld_index'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    # ### end Alembic commands ###
