"""empty message

Revision ID: 57f78d2d10a3
Revises: 66ea073821ac
Create Date: 2018-03-13 22:38:48.555093

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

# revision identifiers, used by Alembic.
revision = '57f78d2d10a3'
down_revision = '66ea073821ac'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('inventory',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('good_id', sa.Integer(), nullable=True),
    sa.Column('goods_allocation_id', sa.Integer(), nullable=True),
    sa.Column('count', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['good_id'], ['goodsed.id'], ),
    sa.ForeignKeyConstraint(['goods_allocation_id'], ['goods_allocation.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.drop_column(u'goodsed', 'sort')
    op.drop_column(u'goodsed', 'count')
    op.drop_column(u'goodsed', 'create_time')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(u'goodsed', sa.Column('create_time', mysql.DATETIME(), nullable=True))
    op.add_column(u'goodsed', sa.Column('count', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
    op.add_column(u'goodsed', sa.Column('sort', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
    op.drop_table('inventory')
    # ### end Alembic commands ###
