"""empty message

Revision ID: 42c9ea53caa4
Revises: 
Create Date: 2019-06-15 16:58:10.766154

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

# revision identifiers, used by Alembic.
revision = '42c9ea53caa4'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('bbs_order')
    op.drop_table('bbs_post')
    op.drop_table('bbs_closeip')
    op.drop_table('bbs_link')
    op.drop_column('bbs_category', 'classpath')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('bbs_category', sa.Column('classpath', mysql.VARCHAR(length=50), nullable=True))
    op.create_table('bbs_link',
    sa.Column('lid', mysql.SMALLINT(display_width=6), autoincrement=True, nullable=False),
    sa.Column('displayorder', mysql.TINYINT(display_width=2), server_default=sa.text("'0'"), autoincrement=False, nullable=False),
    sa.Column('name', mysql.VARCHAR(length=30), nullable=False),
    sa.Column('url', mysql.VARCHAR(length=255), nullable=False),
    sa.Column('description', mysql.MEDIUMTEXT(), nullable=True),
    sa.Column('logo', mysql.VARCHAR(length=255), nullable=True),
    sa.Column('addtime', mysql.INTEGER(display_width=12), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('lid'),
    mysql_default_charset='utf8',
    mysql_engine='InnoDB'
    )
    op.create_table('bbs_closeip',
    sa.Column('id', mysql.INTEGER(display_width=10), autoincrement=True, nullable=False),
    sa.Column('ip', mysql.INTEGER(display_width=10), autoincrement=False, nullable=False),
    sa.Column('addtime', mysql.INTEGER(display_width=10), autoincrement=False, nullable=True),
    sa.Column('over', mysql.INTEGER(display_width=10), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='utf8',
    mysql_engine='InnoDB'
    )
    op.create_table('bbs_post',
    sa.Column('id', mysql.INTEGER(display_width=10), autoincrement=True, nullable=False),
    sa.Column('title', mysql.VARCHAR(length=600), nullable=False),
    sa.Column('content', mysql.LONGTEXT(), nullable=True),
    sa.Column('smiley', mysql.SMALLINT(display_width=6), autoincrement=False, nullable=True),
    sa.Column('addip', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('replycount', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('hits', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('istop', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('elite', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('ishot', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('rate', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('attachment', mysql.SMALLINT(display_width=6), autoincrement=False, nullable=True),
    sa.Column('isdel', mysql.SMALLINT(display_width=6), autoincrement=False, nullable=False),
    sa.Column('style', mysql.VARCHAR(length=10), nullable=True),
    sa.Column('isdisplay', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('category_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('addtime', mysql.DATETIME(fsp=6), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='utf8',
    mysql_engine='InnoDB'
    )
    op.create_table('bbs_order',
    sa.Column('oid', mysql.INTEGER(display_width=10), autoincrement=True, nullable=False),
    sa.Column('uid', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('tid', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('addtime', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('ispay', mysql.TINYINT(display_width=2), server_default=sa.text("'0'"), autoincrement=False, nullable=False),
    sa.PrimaryKeyConstraint('oid'),
    mysql_default_charset='utf8',
    mysql_engine='InnoDB'
    )
    # ### end Alembic commands ###
