"""add restapi table

Revision ID: 3664b3da04af
Revises: db1017ec0147
Create Date: 2018-05-02 20:04:44.470415

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3664b3da04af'
down_revision = 'db1017ec0147'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('rest_trade',
    sa.Column('globalTradeID', sa.Integer(), nullable=False),
    sa.Column('book', sa.String(length=10), nullable=True),
    sa.Column('tradeID', sa.Integer(), nullable=True),
    sa.Column('date', sa.DateTime(), nullable=True),
    sa.Column('type', sa.String(length=5), nullable=True),
    sa.Column('rate', sa.Float(), nullable=True),
    sa.Column('amount', sa.Float(), nullable=True),
    sa.Column('total', sa.Float(), nullable=True),
    sa.PrimaryKeyConstraint('globalTradeID')
    )
    op.add_column('trade', sa.Column('active', sa.Boolean(), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('trade', 'active')
    op.drop_table('rest_trade')
    # ### end Alembic commands ###
