"""payment_router

Revision ID: 66512025d440
Revises: 0a394de23717
Create Date: 2019-09-13 12:17:33.697169

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

# revision identifiers, used by Alembic.
revision = '66512025d440'
down_revision = '0a394de23717'
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! ###
    op.create_table('channel_router',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='自增主键'),
    sa.Column('create_time', sa.Integer(), nullable=False, comment='创建时间'),
    sa.Column('config_list', sa.Text(), nullable=False, comment='支付类型配置'),
    sa.Column('interface', sa.SmallInteger(), nullable=True, comment='接入类型'),
    sa.Column('amount_min', sa.Integer(), nullable=True, comment='交易金额下限'),
    sa.Column('amount_max', sa.Integer(), nullable=True, comment='交易金额上限'),
    sa.Column('merchants', sa.Text(), nullable=True, comment='商户列表'),
    sa.Column('uid_list', sa.Text(), nullable=True, comment='用户列表'),
    sa.PrimaryKeyConstraint('id')
    )
    op.drop_table('channel_guid_rule')
    # ### end Alembic commands ###


def downgrade_():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('channel_guid_rule',
    sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False, comment='自增主键'),
    sa.Column('create_time', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False, comment='创建时间'),
    sa.Column('mch_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=32), nullable=False, comment='商户名称，大写字符串'),
    sa.Column('uid', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False, comment='用户ID'),
    sa.Column('interface', mysql.SMALLINT(display_width=6), autoincrement=False, nullable=False, comment='接入类型'),
    sa.Column('amount_min', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False, comment='交易金额下限'),
    sa.Column('amount_max', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False, comment='交易金额上限'),
    sa.Column('p_method', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=128), nullable=False, comment='支付方法'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.drop_table('channel_router')
    # ### end Alembic commands ###


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


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

