"""empty message

Revision ID: d02514c5640c
Revises: 68f3f3555648
Create Date: 2020-01-26 19:24:59.080888

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

# revision identifiers, used by Alembic.
revision = 'd02514c5640c'
down_revision = '68f3f3555648'
branch_labels = None
depends_on = None


def upgrade(engine_name):
    globals()["upgrade_%s" % engine_name]()


def downgrade(engine_name):
    globals()["downgrade_%s" % engine_name]()





def upgrade_():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def downgrade_():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def upgrade_users():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def downgrade_users():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('mobile_number_update_request', sa.Column('cust_no', mysql.VARCHAR(length=15), nullable=True))
    op.add_column('email_address_update_request', sa.Column('cust_no', mysql.VARCHAR(length=15), nullable=True))
    # ### end Alembic commands ###


def upgrade_assets():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def downgrade_assets():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def upgrade_connection():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def downgrade_connection():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def upgrade_recharge():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def downgrade_recharge():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('payment_provider')
    op.drop_table('lco_transaction_entry')
    # ### end Alembic commands ###


def upgrade_ticket():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def downgrade_ticket():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def upgrade_softphone():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def downgrade_softphone():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index('idx_pname', 'tbl_series_number_generator', ['softphone_no'], unique=False)
    op.create_table('tbl_block',
    sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
    sa.Column('softphone', mysql.VARCHAR(length=100), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='latin1',
    mysql_engine='InnoDB'
    )
    op.create_table('tbl_user',
    sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('name', mysql.VARCHAR(length=700), nullable=True),
    sa.Column('uid', mysql.VARCHAR(length=700), nullable=True),
    sa.Column('pass', mysql.VARCHAR(length=700), nullable=True),
    sa.Column('priviledge', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
    sa.Column('dept', mysql.VARCHAR(length=100), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='latin1',
    mysql_engine='InnoDB'
    )
    op.create_table('tbl_category_master',
    sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
    sa.Column('category_id', mysql.VARCHAR(length=15), nullable=True),
    sa.Column('category_type', mysql.VARCHAR(length=15), nullable=True),
    sa.Column('category_status', mysql.VARCHAR(length=15), nullable=True),
    sa.Column('rate', mysql.DECIMAL(precision=10, scale=2), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='latin1',
    mysql_engine='InnoDB'
    )
    op.create_table('tbl_series_master',
    sa.Column('id', mysql.INTEGER(display_width=10), autoincrement=True, nullable=False),
    sa.Column('series_no', mysql.INTEGER(display_width=10), autoincrement=False, nullable=True),
    sa.Column('series_from', mysql.INTEGER(display_width=10), autoincrement=False, nullable=True),
    sa.Column('series_to', mysql.INTEGER(display_width=10), autoincrement=False, nullable=True),
    sa.Column('series_status', mysql.VARCHAR(length=15), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='latin1',
    mysql_engine='InnoDB'
    )
    # ### end Alembic commands ###


def upgrade_voucher():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('tbl_ott_pkg', sa.Column('ott_provider_name', sa.String(length=100), nullable=False))
    op.alter_column('tbl_ott_pkg', 'ott_pkg_code',
               existing_type=mysql.VARCHAR(length=8),
               nullable=False)
    op.alter_column('tbl_ott_pkg', 'ott_pkg_name',
               existing_type=mysql.VARCHAR(length=100),
               nullable=False)
    op.alter_column('tbl_ott_pkg', 'ott_pkg_priority',
               existing_type=mysql.INTEGER(display_width=4),
               nullable=False)
    op.alter_column('tbl_ott_pkg', 'ott_pkg_rate',
               existing_type=mysql.DECIMAL(precision=10, scale=2),
               nullable=False)
    op.alter_column('tbl_ott_pkg', 'ott_pkg_status',
               existing_type=mysql.VARCHAR(length=15),
               nullable=False)
    op.create_index(op.f('ix_tbl_ott_pkg_ott_provider_code'), 'tbl_ott_pkg', ['ott_provider_code'], unique=False)
    op.drop_index('ott_pkg_code_2', table_name='tbl_ott_pkg')
    op.create_unique_constraint(None, 'tbl_ott_pkg', ['ott_pkg_priority'])
    op.alter_column('tbl_ott_provider', 'ott_provider_app_name',
               existing_type=mysql.VARCHAR(length=50),
               nullable=False)
    op.drop_column('tbl_ott_provider', 'ott_provider_pkg_name')
    op.add_column('tbl_ott_voucher_log', sa.Column('plan_code', sa.String(length=50), nullable=False))
    op.drop_column('tbl_ott_voucher_log', 'plan_name')
    # ### end Alembic commands ###


def downgrade_voucher():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('tbl_ott_voucher_log', sa.Column('plan_name', mysql.VARCHAR(length=50), nullable=False))
    op.drop_column('tbl_ott_voucher_log', 'plan_code')
    op.add_column('tbl_ott_provider', sa.Column('ott_provider_pkg_name', mysql.VARCHAR(length=50), nullable=False))
    op.alter_column('tbl_ott_provider', 'ott_provider_app_name',
               existing_type=mysql.VARCHAR(length=50),
               nullable=True)
    op.drop_constraint(None, 'tbl_ott_pkg', type_='unique')
    op.create_index('ott_pkg_code_2', 'tbl_ott_pkg', ['ott_pkg_code'], unique=False)
    op.drop_index(op.f('ix_tbl_ott_pkg_ott_provider_code'), table_name='tbl_ott_pkg')
    op.alter_column('tbl_ott_pkg', 'ott_pkg_status',
               existing_type=mysql.VARCHAR(length=15),
               nullable=True)
    op.alter_column('tbl_ott_pkg', 'ott_pkg_rate',
               existing_type=mysql.DECIMAL(precision=10, scale=2),
               nullable=True)
    op.alter_column('tbl_ott_pkg', 'ott_pkg_priority',
               existing_type=mysql.INTEGER(display_width=4),
               nullable=True)
    op.alter_column('tbl_ott_pkg', 'ott_pkg_name',
               existing_type=mysql.VARCHAR(length=100),
               nullable=True)
    op.alter_column('tbl_ott_pkg', 'ott_pkg_code',
               existing_type=mysql.VARCHAR(length=8),
               nullable=True)
    op.drop_column('tbl_ott_pkg', 'ott_provider_name')
    # ### end Alembic commands ###


def upgrade_lco():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###


def downgrade_lco():
    # ### commands auto generated by Alembic - please adjust! ###
    pass
    # ### end Alembic commands ###

