"""add relative

Revision ID: b1453945c696
Revises: 9088e93987ee
Create Date: 2018-06-14 13:58:28.997000

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

# revision identifiers, used by Alembic.
revision = 'b1453945c696'
down_revision = '9088e93987ee'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('t_tdtc_fees',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('order_no', sa.String(length=32), nullable=True),
    sa.Column('fee_no', sa.String(length=32), nullable=True),
    sa.Column('year', sa.String(length=8), nullable=True),
    sa.Column('fee_name', sa.String(length=32), nullable=True),
    sa.Column('student_no', sa.String(length=24), nullable=True),
    sa.Column('amt', sa.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('loan_amt', sa.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('detect_amt', sa.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('refund_amt', sa.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('paid_amt', sa.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('fee_desc', sa.String(length=128), nullable=True),
    sa.Column('begin_time', sa.DATETIME(), nullable=True),
    sa.Column('create_time', sa.DATETIME(), nullable=False),
    sa.Column('update_time', sa.DATETIME(), nullable=False),
    sa.Column('remark', sa.String(length=128), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('fee_no'),
    sa.UniqueConstraint('order_no')
    )
    op.drop_index('fee_no', table_name='t_tdtc_orders')
    op.drop_index('order_no', table_name='t_tdtc_orders')
    op.drop_table('t_tdtc_orders')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('t_tdtc_orders',
    sa.Column('id', mysql.INTEGER(display_width=11), nullable=False),
    sa.Column('order_no', mysql.VARCHAR(length=32), nullable=True),
    sa.Column('fee_name', mysql.VARCHAR(length=32), nullable=True),
    sa.Column('student_no', mysql.VARCHAR(length=24), nullable=True),
    sa.Column('create_time', mysql.DATETIME(), nullable=False),
    sa.Column('update_time', mysql.DATETIME(), nullable=False),
    sa.Column('remark', mysql.VARCHAR(length=128), nullable=True),
    sa.Column('amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('begin_time', mysql.DATETIME(), nullable=True),
    sa.Column('detect_amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('fee_desc', mysql.VARCHAR(length=128), nullable=True),
    sa.Column('fee_no', mysql.VARCHAR(length=32), nullable=True),
    sa.Column('loan_amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('paid_amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('refund_amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('year', mysql.VARCHAR(length=8), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset=u'utf8',
    mysql_engine=u'InnoDB'
    )
    op.create_index('order_no', 't_tdtc_orders', ['order_no'], unique=True)
    op.create_index('fee_no', 't_tdtc_orders', ['fee_no'], unique=True)
    op.drop_table('t_tdtc_fees')
    # ### end Alembic commands ###

895e4d5911ca775c5365645a4cd3885986dd94b7
<mask token>


def downgrade():
    op.create_table('t_tdtc_orders', sa.Column('id', mysql.INTEGER(
        display_width=11), nullable=False), sa.Column('order_no', mysql.
        VARCHAR(length=32), nullable=True), sa.Column('fee_name', mysql.
        VARCHAR(length=32), nullable=True), sa.Column('student_no', mysql.
        VARCHAR(length=24), nullable=True), sa.Column('create_time', mysql.
        DATETIME(), nullable=False), sa.Column('update_time', mysql.
        DATETIME(), nullable=False), sa.Column('remark', mysql.VARCHAR(
        length=128), nullable=True), sa.Column('amt', mysql.DECIMAL(
        precision=12, scale=2), nullable=True), sa.Column('begin_time',
        mysql.DATETIME(), nullable=True), sa.Column('detect_amt', mysql.
        DECIMAL(precision=12, scale=2), nullable=True), sa.Column(
        'fee_desc', mysql.VARCHAR(length=128), nullable=True), sa.Column(
        'fee_no', mysql.VARCHAR(length=32), nullable=True), sa.Column(
        'loan_amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
        sa.Column('paid_amt', mysql.DECIMAL(precision=12, scale=2),
        nullable=True), sa.Column('refund_amt', mysql.DECIMAL(precision=12,
        scale=2), nullable=True), sa.Column('year', mysql.VARCHAR(length=8),
        nullable=True), sa.PrimaryKeyConstraint('id'),
        mysql_default_charset=u'utf8', mysql_engine=u'InnoDB')
    op.create_index('order_no', 't_tdtc_orders', ['order_no'], unique=True)
    op.create_index('fee_no', 't_tdtc_orders', ['fee_no'], unique=True)
    op.drop_table('t_tdtc_fees')

<mask token>


def upgrade():
    op.create_table('t_tdtc_fees', sa.Column('id', sa.Integer(), nullable=
        False), sa.Column('order_no', sa.String(length=32), nullable=True),
        sa.Column('fee_no', sa.String(length=32), nullable=True), sa.Column
        ('year', sa.String(length=8), nullable=True), sa.Column('fee_name',
        sa.String(length=32), nullable=True), sa.Column('student_no', sa.
        String(length=24), nullable=True), sa.Column('amt', sa.DECIMAL(
        precision=12, scale=2), nullable=True), sa.Column('loan_amt', sa.
        DECIMAL(precision=12, scale=2), nullable=True), sa.Column(
        'detect_amt', sa.DECIMAL(precision=12, scale=2), nullable=True), sa
        .Column('refund_amt', sa.DECIMAL(precision=12, scale=2), nullable=
        True), sa.Column('paid_amt', sa.DECIMAL(precision=12, scale=2),
        nullable=True), sa.Column('fee_desc', sa.String(length=128),
        nullable=True), sa.Column('begin_time', sa.DATETIME(), nullable=
        True), sa.Column('create_time', sa.DATETIME(), nullable=False), sa.
        Column('update_time', sa.DATETIME(), nullable=False), sa.Column(
        'remark', sa.String(length=128), nullable=True), sa.
        PrimaryKeyConstraint('id'), sa.UniqueConstraint('fee_no'), sa.
        UniqueConstraint('order_no'))
    op.drop_index('fee_no', table_name='t_tdtc_orders')
    op.drop_index('order_no', table_name='t_tdtc_orders')
    op.drop_table('t_tdtc_orders')


def downgrade():
    op.create_table('t_tdtc_orders', sa.Column('id', mysql.INTEGER(
        display_width=11), nullable=False), sa.Column('order_no', mysql.
        VARCHAR(length=32), nullable=True), sa.Column('fee_name', mysql.
        VARCHAR(length=32), nullable=True), sa.Column('student_no', mysql.
        VARCHAR(length=24), nullable=True), sa.Column('create_time', mysql.
        DATETIME(), nullable=False), sa.Column('update_time', mysql.
        DATETIME(), nullable=False), sa.Column('remark', mysql.VARCHAR(
        length=128), nullable=True), sa.Column('amt', mysql.DECIMAL(
        precision=12, scale=2), nullable=True), sa.Column('begin_time',
        mysql.DATETIME(), nullable=True), sa.Column('detect_amt', mysql.
        DECIMAL(precision=12, scale=2), nullable=True), sa.Column(
        'fee_desc', mysql.VARCHAR(length=128), nullable=True), sa.Column(
        'fee_no', mysql.VARCHAR(length=32), nullable=True), sa.Column(
        'loan_amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
        sa.Column('paid_amt', mysql.DECIMAL(precision=12, scale=2),
        nullable=True), sa.Column('refund_amt', mysql.DECIMAL(precision=12,
        scale=2), nullable=True), sa.Column('year', mysql.VARCHAR(length=8),
        nullable=True), sa.PrimaryKeyConstraint('id'),
        mysql_default_charset=u'utf8', mysql_engine=u'InnoDB')
    op.create_index('order_no', 't_tdtc_orders', ['order_no'], unique=True)
    op.create_index('fee_no', 't_tdtc_orders', ['fee_no'], unique=True)
    op.drop_table('t_tdtc_fees')

<mask token>
revision = 'b1453945c696'
down_revision = '9088e93987ee'
branch_labels = None
depends_on = None


def upgrade():
    op.create_table('t_tdtc_fees', sa.Column('id', sa.Integer(), nullable=
        False), sa.Column('order_no', sa.String(length=32), nullable=True),
        sa.Column('fee_no', sa.String(length=32), nullable=True), sa.Column
        ('year', sa.String(length=8), nullable=True), sa.Column('fee_name',
        sa.String(length=32), nullable=True), sa.Column('student_no', sa.
        String(length=24), nullable=True), sa.Column('amt', sa.DECIMAL(
        precision=12, scale=2), nullable=True), sa.Column('loan_amt', sa.
        DECIMAL(precision=12, scale=2), nullable=True), sa.Column(
        'detect_amt', sa.DECIMAL(precision=12, scale=2), nullable=True), sa
        .Column('refund_amt', sa.DECIMAL(precision=12, scale=2), nullable=
        True), sa.Column('paid_amt', sa.DECIMAL(precision=12, scale=2),
        nullable=True), sa.Column('fee_desc', sa.String(length=128),
        nullable=True), sa.Column('begin_time', sa.DATETIME(), nullable=
        True), sa.Column('create_time', sa.DATETIME(), nullable=False), sa.
        Column('update_time', sa.DATETIME(), nullable=False), sa.Column(
        'remark', sa.String(length=128), nullable=True), sa.
        PrimaryKeyConstraint('id'), sa.UniqueConstraint('fee_no'), sa.
        UniqueConstraint('order_no'))
    op.drop_index('fee_no', table_name='t_tdtc_orders')
    op.drop_index('order_no', table_name='t_tdtc_orders')
    op.drop_table('t_tdtc_orders')


def downgrade():
    op.create_table('t_tdtc_orders', sa.Column('id', mysql.INTEGER(
        display_width=11), nullable=False), sa.Column('order_no', mysql.
        VARCHAR(length=32), nullable=True), sa.Column('fee_name', mysql.
        VARCHAR(length=32), nullable=True), sa.Column('student_no', mysql.
        VARCHAR(length=24), nullable=True), sa.Column('create_time', mysql.
        DATETIME(), nullable=False), sa.Column('update_time', mysql.
        DATETIME(), nullable=False), sa.Column('remark', mysql.VARCHAR(
        length=128), nullable=True), sa.Column('amt', mysql.DECIMAL(
        precision=12, scale=2), nullable=True), sa.Column('begin_time',
        mysql.DATETIME(), nullable=True), sa.Column('detect_amt', mysql.
        DECIMAL(precision=12, scale=2), nullable=True), sa.Column(
        'fee_desc', mysql.VARCHAR(length=128), nullable=True), sa.Column(
        'fee_no', mysql.VARCHAR(length=32), nullable=True), sa.Column(
        'loan_amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
        sa.Column('paid_amt', mysql.DECIMAL(precision=12, scale=2),
        nullable=True), sa.Column('refund_amt', mysql.DECIMAL(precision=12,
        scale=2), nullable=True), sa.Column('year', mysql.VARCHAR(length=8),
        nullable=True), sa.PrimaryKeyConstraint('id'),
        mysql_default_charset=u'utf8', mysql_engine=u'InnoDB')
    op.create_index('order_no', 't_tdtc_orders', ['order_no'], unique=True)
    op.create_index('fee_no', 't_tdtc_orders', ['fee_no'], unique=True)
    op.drop_table('t_tdtc_fees')

<mask token>
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
revision = 'b1453945c696'
down_revision = '9088e93987ee'
branch_labels = None
depends_on = None


def upgrade():
    op.create_table('t_tdtc_fees', sa.Column('id', sa.Integer(), nullable=
        False), sa.Column('order_no', sa.String(length=32), nullable=True),
        sa.Column('fee_no', sa.String(length=32), nullable=True), sa.Column
        ('year', sa.String(length=8), nullable=True), sa.Column('fee_name',
        sa.String(length=32), nullable=True), sa.Column('student_no', sa.
        String(length=24), nullable=True), sa.Column('amt', sa.DECIMAL(
        precision=12, scale=2), nullable=True), sa.Column('loan_amt', sa.
        DECIMAL(precision=12, scale=2), nullable=True), sa.Column(
        'detect_amt', sa.DECIMAL(precision=12, scale=2), nullable=True), sa
        .Column('refund_amt', sa.DECIMAL(precision=12, scale=2), nullable=
        True), sa.Column('paid_amt', sa.DECIMAL(precision=12, scale=2),
        nullable=True), sa.Column('fee_desc', sa.String(length=128),
        nullable=True), sa.Column('begin_time', sa.DATETIME(), nullable=
        True), sa.Column('create_time', sa.DATETIME(), nullable=False), sa.
        Column('update_time', sa.DATETIME(), nullable=False), sa.Column(
        'remark', sa.String(length=128), nullable=True), sa.
        PrimaryKeyConstraint('id'), sa.UniqueConstraint('fee_no'), sa.
        UniqueConstraint('order_no'))
    op.drop_index('fee_no', table_name='t_tdtc_orders')
    op.drop_index('order_no', table_name='t_tdtc_orders')
    op.drop_table('t_tdtc_orders')


def downgrade():
    op.create_table('t_tdtc_orders', sa.Column('id', mysql.INTEGER(
        display_width=11), nullable=False), sa.Column('order_no', mysql.
        VARCHAR(length=32), nullable=True), sa.Column('fee_name', mysql.
        VARCHAR(length=32), nullable=True), sa.Column('student_no', mysql.
        VARCHAR(length=24), nullable=True), sa.Column('create_time', mysql.
        DATETIME(), nullable=False), sa.Column('update_time', mysql.
        DATETIME(), nullable=False), sa.Column('remark', mysql.VARCHAR(
        length=128), nullable=True), sa.Column('amt', mysql.DECIMAL(
        precision=12, scale=2), nullable=True), sa.Column('begin_time',
        mysql.DATETIME(), nullable=True), sa.Column('detect_amt', mysql.
        DECIMAL(precision=12, scale=2), nullable=True), sa.Column(
        'fee_desc', mysql.VARCHAR(length=128), nullable=True), sa.Column(
        'fee_no', mysql.VARCHAR(length=32), nullable=True), sa.Column(
        'loan_amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
        sa.Column('paid_amt', mysql.DECIMAL(precision=12, scale=2),
        nullable=True), sa.Column('refund_amt', mysql.DECIMAL(precision=12,
        scale=2), nullable=True), sa.Column('year', mysql.VARCHAR(length=8),
        nullable=True), sa.PrimaryKeyConstraint('id'),
        mysql_default_charset=u'utf8', mysql_engine=u'InnoDB')
    op.create_index('order_no', 't_tdtc_orders', ['order_no'], unique=True)
    op.create_index('fee_no', 't_tdtc_orders', ['fee_no'], unique=True)
    op.drop_table('t_tdtc_fees')

"""add relative

Revision ID: b1453945c696
Revises: 9088e93987ee
Create Date: 2018-06-14 13:58:28.997000

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

# revision identifiers, used by Alembic.
revision = 'b1453945c696'
down_revision = '9088e93987ee'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('t_tdtc_fees',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('order_no', sa.String(length=32), nullable=True),
    sa.Column('fee_no', sa.String(length=32), nullable=True),
    sa.Column('year', sa.String(length=8), nullable=True),
    sa.Column('fee_name', sa.String(length=32), nullable=True),
    sa.Column('student_no', sa.String(length=24), nullable=True),
    sa.Column('amt', sa.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('loan_amt', sa.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('detect_amt', sa.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('refund_amt', sa.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('paid_amt', sa.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('fee_desc', sa.String(length=128), nullable=True),
    sa.Column('begin_time', sa.DATETIME(), nullable=True),
    sa.Column('create_time', sa.DATETIME(), nullable=False),
    sa.Column('update_time', sa.DATETIME(), nullable=False),
    sa.Column('remark', sa.String(length=128), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('fee_no'),
    sa.UniqueConstraint('order_no')
    )
    op.drop_index('fee_no', table_name='t_tdtc_orders')
    op.drop_index('order_no', table_name='t_tdtc_orders')
    op.drop_table('t_tdtc_orders')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('t_tdtc_orders',
    sa.Column('id', mysql.INTEGER(display_width=11), nullable=False),
    sa.Column('order_no', mysql.VARCHAR(length=32), nullable=True),
    sa.Column('fee_name', mysql.VARCHAR(length=32), nullable=True),
    sa.Column('student_no', mysql.VARCHAR(length=24), nullable=True),
    sa.Column('create_time', mysql.DATETIME(), nullable=False),
    sa.Column('update_time', mysql.DATETIME(), nullable=False),
    sa.Column('remark', mysql.VARCHAR(length=128), nullable=True),
    sa.Column('amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('begin_time', mysql.DATETIME(), nullable=True),
    sa.Column('detect_amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('fee_desc', mysql.VARCHAR(length=128), nullable=True),
    sa.Column('fee_no', mysql.VARCHAR(length=32), nullable=True),
    sa.Column('loan_amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('paid_amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('refund_amt', mysql.DECIMAL(precision=12, scale=2), nullable=True),
    sa.Column('year', mysql.VARCHAR(length=8), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset=u'utf8',
    mysql_engine=u'InnoDB'
    )
    op.create_index('order_no', 't_tdtc_orders', ['order_no'], unique=True)
    op.create_index('fee_no', 't_tdtc_orders', ['fee_no'], unique=True)
    op.drop_table('t_tdtc_fees')
    # ### end Alembic commands ###
