"""empty message

Revision ID: 48753833ffff
Revises: 
Create Date: 2018-07-30 11:48:54.549066

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '48753833ffff'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('auth',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('name', sa.String(length=255), nullable=True),
    sa.Column('module', sa.String(length=255), nullable=True),
    sa.Column('opr_url', sa.String(length=255), nullable=True),
    sa.Column('need_auditing', sa.Boolean(), nullable=True),
    sa.Column('enable', sa.Boolean(), nullable=True),
    sa.Column('creator', sa.Integer(), nullable=True),
    sa.Column('create_time', sa.DateTime(), nullable=True),
    sa.Column('updator', sa.Integer(), nullable=True),
    sa.Column('update_time', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('media',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('name', sa.String(length=255), nullable=True),
    sa.Column('type', sa.String(length=64), nullable=True),
    sa.Column('size', sa.Integer(), nullable=True),
    sa.Column('url', sa.String(length=255), nullable=True),
    sa.Column('describe', sa.String(length=255), nullable=True),
    sa.Column('uploader', sa.Integer(), nullable=True),
    sa.Column('resolution', sa.String(length=64), nullable=True),
    sa.Column('time_length', sa.Integer(), nullable=True),
    sa.Column('create_time', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('media_conf',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('type_name', sa.String(length=64), nullable=True),
    sa.Column('format', sa.String(length=255), nullable=True),
    sa.Column('limit_size', sa.Integer(), nullable=True),
    sa.Column('create_time', sa.DateTime(), nullable=True),
    sa.Column('update_time', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('message',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('title', sa.String(length=255), nullable=True),
    sa.Column('m_type', sa.Integer(), nullable=True),
    sa.Column('context', sa.Text(), nullable=True),
    sa.Column('receiver_num', sa.Integer(), nullable=True),
    sa.Column('sender', sa.Integer(), nullable=True),
    sa.Column('is_del', sa.Integer(), nullable=True),
    sa.Column('read_num', sa.Integer(), nullable=True),
    sa.Column('send_time', sa.DateTime(), nullable=True),
    sa.Column('read_time', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('metadata',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('name', sa.String(length=255), nullable=True),
    sa.Column('version', sa.String(length=255), nullable=True),
    sa.Column('company', sa.String(length=255), nullable=True),
    sa.Column('logo', sa.String(length=255), nullable=True),
    sa.Column('favicon', sa.String(length=255), nullable=True),
    sa.Column('lock_user_threshold', sa.Integer(), nullable=True),
    sa.Column('captcha_threshold', sa.Boolean(), nullable=True),
    sa.Column('create_time', sa.DateTime(), nullable=True),
    sa.Column('modify_time', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('opr_log',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('opr_url', sa.String(length=255), nullable=True),
    sa.Column('browser', sa.String(length=255), nullable=True),
    sa.Column('platform', sa.String(length=255), nullable=True),
    sa.Column('uip', sa.String(length=255), nullable=True),
    sa.Column('old_data', sa.Text(), nullable=True),
    sa.Column('new_data', sa.Text(), nullable=True),
    sa.Column('operator', sa.Integer(), nullable=True),
    sa.Column('success', sa.Integer(), nullable=True),
    sa.Column('operate_time', sa.DateTime(), nullable=True),
    sa.Column('module', sa.String(length=255), nullable=True),
    sa.Column('name', sa.String(length=255), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('organization',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('name', sa.String(length=255), nullable=True),
    sa.Column('pid', sa.Integer(), nullable=True),
    sa.Column('enable', sa.Boolean(), nullable=True),
    sa.Column('description', sa.String(length=255), nullable=True),
    sa.Column('creator', sa.Integer(), nullable=True),
    sa.Column('create_time', sa.DateTime(), nullable=True),
    sa.Column('updator', sa.Integer(), nullable=True),
    sa.Column('update_time', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('role',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('name', sa.String(length=255), nullable=True),
    sa.Column('description', sa.String(length=255), nullable=True),
    sa.Column('enable', sa.Boolean(), nullable=True),
    sa.Column('creator', sa.Integer(), nullable=True),
    sa.Column('create_time', sa.DateTime(), nullable=True),
    sa.Column('updator', sa.Integer(), nullable=True),
    sa.Column('update_time', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('role_auth',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('role_id', sa.Integer(), nullable=True),
    sa.Column('auth_id', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('org_id', sa.Integer(), nullable=True),
    sa.Column('role_id', sa.Integer(), nullable=True),
    sa.Column('username', sa.String(length=255), nullable=True),
    sa.Column('password', sa.String(length=255), nullable=True),
    sa.Column('real_name', sa.String(length=255), nullable=True),
    sa.Column('email', sa.String(length=255), nullable=True),
    sa.Column('tel', sa.String(length=255), nullable=True),
    sa.Column('profile_photo', sa.String(length=255), nullable=True),
    sa.Column('login_error_num', sa.Integer(), nullable=True),
    sa.Column('enable', sa.Boolean(), nullable=True),
    sa.Column('description', sa.String(length=255), nullable=True),
    sa.Column('last_login_time', sa.DateTime(), nullable=True),
    sa.Column('creator', sa.Integer(), nullable=True),
    sa.Column('create_time', sa.DateTime(), nullable=True),
    sa.Column('updator', sa.Integer(), nullable=True),
    sa.Column('update_time', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user_pk_message',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('msg_id', sa.String(length=255), nullable=True),
    sa.Column('title', sa.String(length=255), nullable=True),
    sa.Column('m_type', sa.Integer(), nullable=True),
    sa.Column('receiver', sa.Integer(), nullable=True),
    sa.Column('sender', sa.Integer(), nullable=True),
    sa.Column('isread', sa.Integer(), nullable=True),
    sa.Column('is_del', sa.Integer(), nullable=True),
    sa.Column('send_time', sa.DateTime(), nullable=True),
    sa.Column('read_time', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('user_pk_message')
    op.drop_table('user')
    op.drop_table('role_auth')
    op.drop_table('role')
    op.drop_table('organization')
    op.drop_table('opr_log')
    op.drop_table('metadata')
    op.drop_table('message')
    op.drop_table('media_conf')
    op.drop_table('media')
    op.drop_table('auth')
    # ### end Alembic commands ###
