"""empty message

Revision ID: 0360b335305b
Revises: a649c70d0b3f
Create Date: 2018-10-18 19:47:56.247012

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '0360b335305b'
down_revision = 'a649c70d0b3f'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('axf_user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('u_username', sa.String(length=32), nullable=True),
    sa.Column('u_password', sa.String(length=256), nullable=True),
    sa.Column('u_email', sa.String(length=64), nullable=True),
    sa.Column('u_icon', sa.String(length=256), nullable=True),
    sa.Column('is_active', sa.Boolean(), nullable=True),
    sa.Column('is_delete', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('u_email'),
    sa.UniqueConstraint('u_username')
    )
    op.create_table('axf_cart',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('c_user_id', sa.Integer(), nullable=True),
    sa.Column('c_goods_id', sa.Integer(), nullable=True),
    sa.Column('c_goods_num', sa.Integer(), nullable=True),
    sa.Column('c_is_select', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['c_goods_id'], ['axf_goods.id'], ),
    sa.ForeignKeyConstraint(['c_user_id'], ['axf_user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('axf_order',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('o_user', sa.Integer(), nullable=True),
    sa.Column('o_price', sa.Float(), nullable=True),
    sa.Column('o_time', sa.DateTime(), nullable=True),
    sa.Column('o_status', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['o_user'], ['axf_user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('axf_ordergoods',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('o_order_id', sa.Integer(), nullable=True),
    sa.Column('o_goods_id', sa.Integer(), nullable=True),
    sa.Column('o_goods_num', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['o_goods_id'], ['axf_goods.id'], ),
    sa.ForeignKeyConstraint(['o_order_id'], ['axf_order.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('axf_ordergoods')
    op.drop_table('axf_order')
    op.drop_table('axf_cart')
    op.drop_table('axf_user')
    # ### end Alembic commands ###
