"""Add table for keepalive

Revision ID: f5d6c3692a93
Revises: a533a244960d
Create Date: 2017-05-08 21:11:50.467761

"""

# revision identifiers, used by Alembic.
revision = 'f5d6c3692a93'
down_revision = 'a533a244960d'
branch_labels = None
depends_on = None

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

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('trade_keep_alive',
    sa.Column('keep_alive_id', sa.Integer(), nullable=False),
    sa.Column('app_name', sa.String(length=20), nullable=True),
    sa.Column('refresh_time', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('keep_alive_id')
    )
    op.alter_column('stock_lowest_unit', 'is_integer',
               existing_type=mysql.TINYINT(display_width=1),
               type_=sa.Boolean(),
               existing_nullable=True)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('stock_lowest_unit', 'is_integer',
               existing_type=sa.Boolean(),
               type_=mysql.TINYINT(display_width=1),
               existing_nullable=True)
    op.drop_table('trade_keep_alive')
    ### end Alembic commands ###
