"""empty message

Revision ID: 660c5b2dc806
Revises: 
Create Date: 2018-07-02 02:22:40.984650

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '660c5b2dc806'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('group',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('test',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('total_monthly',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('account_code', sa.String(length=64), nullable=True),
    sa.Column('account_name_long', sa.String(length=64), nullable=True),
    sa.Column('effective_date', sa.Date(), nullable=True),
    sa.Column('performance_scheme_code', sa.String(length=64), nullable=True),
    sa.Column('asset_class', sa.String(length=64), nullable=True),
    sa.Column('country', sa.String(length=64), nullable=True),
    sa.Column('sector', sa.String(length=64), nullable=True),
    sa.Column('industry', sa.String(length=64), nullable=True),
    sa.Column('security_name', sa.String(length=64), nullable=True),
    sa.Column('security_name_long', sa.String(length=64), nullable=True),
    sa.Column('sec_ssc_id', sa.String(length=64), nullable=True),
    sa.Column('emv', sa.Float(), nullable=True),
    sa.Column('bmv', sa.Float(), nullable=True),
    sa.Column('abal', sa.Float(), nullable=True),
    sa.Column('abal_zero', sa.Float(), nullable=True),
    sa.Column('abal_mid', sa.Float(), nullable=True),
    sa.Column('abal_full', sa.Float(), nullable=True),
    sa.Column('base_flows', sa.Float(), nullable=True),
    sa.Column('value_add', sa.Float(), nullable=True),
    sa.Column('gain_loss', sa.Float(), nullable=True),
    sa.Column('inc', sa.Float(), nullable=True),
    sa.Column('inflws', sa.Float(), nullable=True),
    sa.Column('otflw_val', sa.Float(), nullable=True),
    sa.Column('net_csh_flw', sa.Float(), nullable=True),
    sa.Column('ror', sa.Float(), nullable=True),
    sa.Column('rates_rule', sa.Integer(), nullable=True),
    sa.Column('mgr_fees', sa.Float(), nullable=True),
    sa.Column('oth_fees', sa.Float(), nullable=True),
    sa.Column('index_code', sa.String(length=64), nullable=True),
    sa.Column('index_ror', sa.Float(), nullable=True),
    sa.Column('index_short_name', sa.String(length=128), nullable=True),
    sa.Column('account_type', sa.String(length=64), nullable=True),
    sa.Column('daily_flag', sa.String(length=64), nullable=True),
    sa.Column('as_of_tms', sa.Date(), nullable=True),
    sa.Column('as_at_tms', sa.Integer(), nullable=True),
    sa.Column('fund_tree_name', sa.String(length=64), nullable=True),
    sa.Column('concat_all', sa.String(length=64), nullable=True),
    sa.Column('p_c_flag', sa.String(length=2), nullable=True),
    sa.Column('country_date', sa.Date(), nullable=True),
    sa.Column('day_type', sa.Integer(), nullable=True),
    sa.Column('monthend', sa.Integer(), nullable=True),
    sa.Column('last_business_date', sa.Date(), nullable=True),
    sa.Column('next_business_date', sa.Date(), nullable=True),
    sa.Column('last_month_end_date', sa.Date(), nullable=True),
    sa.Column('next_month_end_date', sa.Date(), nullable=True),
    sa.Column('bda_as_at_tms', sa.Date(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_total_monthly_account_code'), 'total_monthly', ['account_code'], unique=False)
    op.create_index(op.f('ix_total_monthly_account_type'), 'total_monthly', ['account_type'], unique=False)
    op.create_index(op.f('ix_total_monthly_concat_all'), 'total_monthly', ['concat_all'], unique=False)
    op.create_index(op.f('ix_total_monthly_effective_date'), 'total_monthly', ['effective_date'], unique=False)
    op.create_index(op.f('ix_total_monthly_fund_tree_name'), 'total_monthly', ['fund_tree_name'], unique=False)
    op.create_index(op.f('ix_total_monthly_p_c_flag'), 'total_monthly', ['p_c_flag'], unique=False)
    op.create_index(op.f('ix_total_monthly_rates_rule'), 'total_monthly', ['rates_rule'], unique=False)
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('email', sa.String(length=64), nullable=True),
    sa.Column('password_hash', sa.String(length=128), nullable=True),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('tel', sa.String(length=64), nullable=True),
    sa.Column('about', sa.Text(), nullable=True),
    sa.Column('position', sa.Text(), nullable=True),
    sa.Column('role_id', sa.Integer(), nullable=True),
    sa.Column('group_id', sa.Integer(), nullable=True),
    sa.Column('created_time', sa.DateTime(), nullable=True),
    sa.Column('updated_time', sa.DateTime(), nullable=True),
    sa.Column('status', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['group_id'], ['group.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_user_email'), table_name='user')
    op.drop_table('user')
    op.drop_index(op.f('ix_total_monthly_rates_rule'), table_name='total_monthly')
    op.drop_index(op.f('ix_total_monthly_p_c_flag'), table_name='total_monthly')
    op.drop_index(op.f('ix_total_monthly_fund_tree_name'), table_name='total_monthly')
    op.drop_index(op.f('ix_total_monthly_effective_date'), table_name='total_monthly')
    op.drop_index(op.f('ix_total_monthly_concat_all'), table_name='total_monthly')
    op.drop_index(op.f('ix_total_monthly_account_type'), table_name='total_monthly')
    op.drop_index(op.f('ix_total_monthly_account_code'), table_name='total_monthly')
    op.drop_table('total_monthly')
    op.drop_table('test')
    op.drop_table('group')
    # ### end Alembic commands ###
