"""empty message

Revision ID: 2d0e51177a90
Revises: 8e3037c3b1df
Create Date: 2018-07-30 23:14:49.631151

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '2d0e51177a90'
down_revision = '8e3037c3b1df'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('front_user',
    sa.Column('id', sa.String(length=100), nullable=False),
    sa.Column('telephone', sa.String(length=11), nullable=False),
    sa.Column('username', sa.String(length=100), nullable=False),
    sa.Column('_password', sa.String(length=100), nullable=False),
    sa.Column('email', sa.String(length=100), nullable=True),
    sa.Column('join_time', sa.DateTime(), nullable=True),
    sa.Column('is_active', sa.Boolean(), nullable=True),
    sa.Column('last_login_time', sa.DateTime(), nullable=True),
    sa.Column('qq', sa.String(length=20), nullable=True),
    sa.Column('realname', sa.String(length=20), nullable=True),
    sa.Column('gender', sa.Integer(), nullable=True),
    sa.Column('signature', sa.String(length=100), nullable=True),
    sa.Column('points', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email')
    )
    op.create_foreign_key(None, 'cms_user_role', 'cms_user', ['user_id'], ['id'])
    op.create_foreign_key(None, 'cms_user_role', 'cms_role', ['role_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'cms_user_role', type_='foreignkey')
    op.drop_constraint(None, 'cms_user_role', type_='foreignkey')
    op.drop_table('front_user')
    # ### end Alembic commands ###
