"""empty message

Revision ID: 4cbb68bb2f3f
Revises: 2fcb208e8cf4
Create Date: 2020-01-21 14:35:43.612290

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

# revision identifiers, used by Alembic.
revision = '4cbb68bb2f3f'
down_revision = '2fcb208e8cf4'
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))
    op.alter_column('customer_info', 'user_name',
               existing_type=mysql.VARCHAR(length=100),
               nullable=True)
    op.alter_column('customer_info', 'ip_addr',
               existing_type=mysql.VARCHAR(length=100),
               nullable=True)
    op.alter_column('customer_info', 'installation_address',
               existing_type=mysql.VARCHAR(length=500),
               nullable=True)
    op.alter_column('customer_info', 'customer_no',
               existing_type=mysql.VARCHAR(length=20),
               nullable=True)
    op.alter_column('customer_info', 'customer_name',
               existing_type=mysql.VARCHAR(length=400),
               nullable=True)
    op.alter_column('customer_info', 'billing_address',
               existing_type=mysql.VARCHAR(length=500),
               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('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_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'
    )
    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'
    )
    # ### end Alembic commands ###


def upgrade_voucher():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('tbl_ott_voucher_log', sa.Column('ott_pkg_name', sa.String(length=50), nullable=False))
    op.add_column('tbl_ott_voucher_log', sa.Column('ott_provider_name', sa.String(length=50), nullable=False))
    op.alter_column('tbl_ott_voucher_log', 'customer_no',
               existing_type=mysql.INTEGER(display_width=10),
               nullable=False)
    op.alter_column('tbl_ott_voucher_log', 'ott_pkg_code',
               existing_type=mysql.VARCHAR(length=8),
               nullable=False)
    op.alter_column('tbl_ott_voucher_log', 'ott_provider_code',
               existing_type=mysql.VARCHAR(length=8),
               nullable=False)
    op.alter_column('tbl_ott_voucher_log', 'ott_voucher_code',
               existing_type=mysql.VARCHAR(length=50),
               nullable=False)
    op.alter_column('tbl_ott_voucher_log', 'plan_name',
               existing_type=mysql.VARCHAR(length=50),
               nullable=False)
    op.alter_column('tbl_ott_voucher_log', 'voucher_end_dt',
               existing_type=sa.DATE(),
               nullable=False)
    op.alter_column('tbl_ott_voucher_log', 'voucher_send_dt',
               existing_type=sa.DATE(),
               nullable=False)
    # ### end Alembic commands ###


def downgrade_voucher():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('tbl_ott_voucher_log', 'voucher_send_dt',
               existing_type=sa.DATE(),
               nullable=True)
    op.alter_column('tbl_ott_voucher_log', 'voucher_end_dt',
               existing_type=sa.DATE(),
               nullable=True)
    op.alter_column('tbl_ott_voucher_log', 'plan_name',
               existing_type=mysql.VARCHAR(length=50),
               nullable=True)
    op.alter_column('tbl_ott_voucher_log', 'ott_voucher_code',
               existing_type=mysql.VARCHAR(length=50),
               nullable=True)
    op.alter_column('tbl_ott_voucher_log', 'ott_provider_code',
               existing_type=mysql.VARCHAR(length=8),
               nullable=True)
    op.alter_column('tbl_ott_voucher_log', 'ott_pkg_code',
               existing_type=mysql.VARCHAR(length=8),
               nullable=True)
    op.alter_column('tbl_ott_voucher_log', 'customer_no',
               existing_type=mysql.INTEGER(display_width=10),
               nullable=True)
    op.drop_column('tbl_ott_voucher_log', 'ott_provider_name')
    op.drop_column('tbl_ott_voucher_log', 'ott_pkg_name')
    op.create_table('tbl_ott_pkg',
    sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
    sa.Column('ott_provider_code', mysql.VARCHAR(length=8), nullable=True),
    sa.Column('ott_pkg_code', mysql.VARCHAR(length=8), nullable=True),
    sa.Column('ott_pkg_name', mysql.VARCHAR(length=100), nullable=True),
    sa.Column('ott_pkg_rate', mysql.DECIMAL(precision=10, scale=2), nullable=True),
    sa.Column('ott_pkg_validity', mysql.INTEGER(display_width=8), autoincrement=False, nullable=True),
    sa.Column('ott_pkg_start_dt', sa.DATE(), nullable=True),
    sa.Column('ott_pkg_end_dt', sa.DATE(), nullable=True),
    sa.Column('ott_pkg_priority', mysql.INTEGER(display_width=4), autoincrement=False, nullable=True),
    sa.Column('ott_pkg_status', mysql.VARCHAR(length=15), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='latin1',
    mysql_engine='InnoDB'
    )
    # ### end Alembic commands ###


def upgrade_lco():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('lco_info',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('lco_code', sa.String(length=10), nullable=False),
    sa.Column('name', sa.String(length=100), nullable=False),
    sa.Column('address', sa.String(length=500), nullable=False),
    sa.Column('email_id', sa.String(length=50), nullable=False),
    sa.Column('mobile_number', sa.String(length=10), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('lco_login',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('lco_code', sa.String(length=10), nullable=False),
    sa.Column('password_hash', sa.String(length=100), nullable=True),
    sa.Column('status', sa.String(length=8), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade_lco():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('lco_login')
    op.drop_table('lco_info')
    # ### end Alembic commands ###

