"""empty message

Revision ID: 3b69c0d9e66e
Revises: 8a6ec38d52ce
Create Date: 2020-10-24 18:12:06.854281

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

# revision identifiers, used by Alembic.
revision = '3b69c0d9e66e'
down_revision = '8a6ec38d52ce'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('id', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_change_by_id', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_comment_id', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_create_by_id', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_deleted_by_id', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_state', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_subscriber_id', table_name='vote_comment_support')
    op.drop_table('vote_comment_support')
    op.drop_index('id', table_name='vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_activity_id', table_name='vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_change_by_id', table_name='vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_create_by_id', table_name='vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_deleted_by_id', table_name='vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_state', table_name='vote_luck_draw_gift')
    op.drop_table('vote_luck_draw_gift')
    op.drop_index('id', table_name='vote_player_comment')
    op.drop_index('ix_vote_player_comment_change_by_id', table_name='vote_player_comment')
    op.drop_index('ix_vote_player_comment_create_by_id', table_name='vote_player_comment')
    op.drop_index('ix_vote_player_comment_deleted_by_id', table_name='vote_player_comment')
    op.drop_index('ix_vote_player_comment_player_id', table_name='vote_player_comment')
    op.drop_index('ix_vote_player_comment_state', table_name='vote_player_comment')
    op.drop_table('vote_player_comment')
    op.drop_index('id', table_name='vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_change_by_id', table_name='vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_create_by_id', table_name='vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_deleted_by_id', table_name='vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_gift_id', table_name='vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_state', table_name='vote_subscriber_gift')
    op.drop_table('vote_subscriber_gift')
    op.drop_index('id', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_activity_id', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_change_by_id', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_create_by_id', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_deleted_by_id', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_player_name', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_state', table_name='vote_activity_player')
    op.drop_table('vote_activity_player')
    op.drop_index('id', table_name='vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_activity_name', table_name='vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_change_by_id', table_name='vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_create_by_id', table_name='vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_deleted_by_id', table_name='vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_state', table_name='vote_activity_manage')
    op.drop_table('vote_activity_manage')
    op.alter_column('sys_menu', 'menu_url',
               existing_type=mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=100),
               comment='权限标识,即标识每一个操作权限',
               existing_comment='请求地址,即访问后台接口的url',
               existing_nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('sys_menu', 'menu_url',
               existing_type=mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=100),
               comment='请求地址,即访问后台接口的url',
               existing_comment='权限标识,即标识每一个操作权限',
               existing_nullable=False)
    op.create_table('vote_activity_manage',
    sa.Column('id', mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='主键ID'),
    sa.Column('state', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'),
    sa.Column('create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
    sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'),
    sa.Column('last_change_time', mysql.DATETIME(), nullable=True, comment='最后修改的时间'),
    sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
    sa.Column('deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
    sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='删除者id'),
    sa.Column('activity_name', mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=100), nullable=False, comment='活动名称'),
    sa.Column('activity_img', mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=300), nullable=False, comment='活动图片'),
    sa.Column('showcase_img', mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=300), nullable=False, comment='橱窗图'),
    sa.Column('bg_color', mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=30), nullable=True, comment='背景颜色'),
    sa.Column('limit_type', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='限制的方式,0为不限制,1为对账号限制,2为每天限制'),
    sa.Column('limit_num', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='对单用户限制的投票次数'),
    sa.Column('can_comment', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True, comment='投票后是否支持评论, 默认不支持'),
    sa.Column('vote_activity_type', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='投票后的游戏, 0为没有活动, 1为幸运大转盘, 2为幸运九宫格, 3为幸福刮刮乐, 4为答题有奖, 5为玩游戏有奖'),
    sa.Column('against_vote_num', mysql.INTEGER(), autoincrement=False, nullable=True, comment='反对的投票数量'),
    sa.Column('lottery_limit', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True, comment='是否限制抽奖'),
    sa.Column('lottery_num', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='一次投票活动中用户的抽奖次数限制'),
    sa.Column('lucky_draw_remarks', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=100), nullable=True, comment='抽奖备注'),
    sa.Column('support_vote_num', mysql.INTEGER(), autoincrement=False, nullable=True, comment='支持的投票数量'),
    sa.Column('end_date', sa.DATE(), nullable=False, comment='活动结束日期'),
    sa.Column('start_date', sa.DATE(), nullable=False, comment='活动开始日期'),
    sa.CheckConstraint('(`lottery_limit` in (0,1))', name='vote_activity_manage_chk_2'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB',
    mysql_row_format='DYNAMIC'
    )
    op.create_index('ix_vote_activity_manage_state', 'vote_activity_manage', ['state'], unique=False)
    op.create_index('ix_vote_activity_manage_deleted_by_id', 'vote_activity_manage', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_create_by_id', 'vote_activity_manage', ['create_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_change_by_id', 'vote_activity_manage', ['change_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_activity_name', 'vote_activity_manage', ['activity_name'], unique=False)
    op.create_index('id', 'vote_activity_manage', ['id'], unique=True)
    op.create_table('vote_activity_player',
    sa.Column('id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='主键ID'),
    sa.Column('state', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'),
    sa.Column('create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
    sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'),
    sa.Column('last_change_time', mysql.DATETIME(), nullable=True, comment='最后修改的时间'),
    sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
    sa.Column('deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
    sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='删除者id'),
    sa.Column('player_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=100), nullable=False, comment='选手姓名'),
    sa.Column('player_img', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=300), nullable=False, comment='选手图片'),
    sa.Column('player_comment', mysql.TEXT(collation='utf8mb4_unicode_ci'), nullable=False, comment='选手介绍'),
    sa.Column('player_speech', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=100), nullable=True, comment='选手感言'),
    sa.Column('activity_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='投票活动ID'),
    sa.Column('support_vote_num', mysql.INTEGER(), autoincrement=False, nullable=True, comment='支持的投票数量'),
    sa.Column('against_vote_num', mysql.INTEGER(), autoincrement=False, nullable=True, comment='反对的投票数量'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('ix_vote_activity_player_state', 'vote_activity_player', ['state'], unique=False)
    op.create_index('ix_vote_activity_player_player_name', 'vote_activity_player', ['player_name'], unique=False)
    op.create_index('ix_vote_activity_player_deleted_by_id', 'vote_activity_player', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_create_by_id', 'vote_activity_player', ['create_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_change_by_id', 'vote_activity_player', ['change_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_activity_id', 'vote_activity_player', ['activity_id'], unique=False)
    op.create_index('id', 'vote_activity_player', ['id'], unique=True)
    op.create_table('vote_subscriber_gift',
    sa.Column('id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='主键ID'),
    sa.Column('state', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'),
    sa.Column('create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
    sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'),
    sa.Column('last_change_time', mysql.DATETIME(), nullable=True, comment='最后修改的时间'),
    sa.Column('deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
    sa.Column('gift_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='奖品ID'),
    sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
    sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='删除者id'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('ix_vote_subscriber_gift_state', 'vote_subscriber_gift', ['state'], unique=False)
    op.create_index('ix_vote_subscriber_gift_gift_id', 'vote_subscriber_gift', ['gift_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_deleted_by_id', 'vote_subscriber_gift', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_create_by_id', 'vote_subscriber_gift', ['create_by_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_change_by_id', 'vote_subscriber_gift', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_subscriber_gift', ['id'], unique=True)
    op.create_table('vote_player_comment',
    sa.Column('id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='主键ID'),
    sa.Column('state', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'),
    sa.Column('create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
    sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'),
    sa.Column('last_change_time', mysql.DATETIME(), nullable=True, comment='最后修改的时间'),
    sa.Column('deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
    sa.Column('player_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='选手ID'),
    sa.Column('parent_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=True, comment='评论者id自关联'),
    sa.Column('support_or_against', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True, comment='支持还是反对'),
    sa.Column('comment', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=150), nullable=False, comment='评论'),
    sa.Column('support_num', mysql.INTEGER(), autoincrement=False, nullable=True, comment='点赞数'),
    sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
    sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='删除者id'),
    sa.CheckConstraint('(`support_or_against` in (0,1))', name='vote_player_comment_chk_1'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('ix_vote_player_comment_state', 'vote_player_comment', ['state'], unique=False)
    op.create_index('ix_vote_player_comment_player_id', 'vote_player_comment', ['player_id'], unique=False)
    op.create_index('ix_vote_player_comment_deleted_by_id', 'vote_player_comment', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_player_comment_create_by_id', 'vote_player_comment', ['create_by_id'], unique=False)
    op.create_index('ix_vote_player_comment_change_by_id', 'vote_player_comment', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_player_comment', ['id'], unique=True)
    op.create_table('vote_luck_draw_gift',
    sa.Column('id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='主键ID'),
    sa.Column('state', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'),
    sa.Column('create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
    sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'),
    sa.Column('last_change_time', mysql.DATETIME(), nullable=True, comment='最后修改的时间'),
    sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
    sa.Column('deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
    sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='删除者id'),
    sa.Column('activity_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='投票活动ID'),
    sa.Column('gift_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=100), nullable=False, comment='奖品名称'),
    sa.Column('gift_img', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=300), nullable=True, comment='奖品相片'),
    sa.Column('winning_chance', mysql.FLOAT(), nullable=False, comment='中奖几率'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('ix_vote_luck_draw_gift_state', 'vote_luck_draw_gift', ['state'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_deleted_by_id', 'vote_luck_draw_gift', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_create_by_id', 'vote_luck_draw_gift', ['create_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_change_by_id', 'vote_luck_draw_gift', ['change_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_activity_id', 'vote_luck_draw_gift', ['activity_id'], unique=False)
    op.create_index('id', 'vote_luck_draw_gift', ['id'], unique=True)
    op.create_table('vote_comment_support',
    sa.Column('id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='主键ID'),
    sa.Column('state', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'),
    sa.Column('create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
    sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'),
    sa.Column('last_change_time', mysql.DATETIME(), nullable=True, comment='最后修改的时间'),
    sa.Column('deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
    sa.Column('comment_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='评论id'),
    sa.Column('subscriber_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='点赞者id'),
    sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
    sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='删除者id'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('ix_vote_comment_support_subscriber_id', 'vote_comment_support', ['subscriber_id'], unique=False)
    op.create_index('ix_vote_comment_support_state', 'vote_comment_support', ['state'], unique=False)
    op.create_index('ix_vote_comment_support_deleted_by_id', 'vote_comment_support', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_comment_support_create_by_id', 'vote_comment_support', ['create_by_id'], unique=False)
    op.create_index('ix_vote_comment_support_comment_id', 'vote_comment_support', ['comment_id'], unique=False)
    op.create_index('ix_vote_comment_support_change_by_id', 'vote_comment_support', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_comment_support', ['id'], unique=True)
    # ### end Alembic commands ###

00dfcdb00348bc907040b5efb5314fe2ebccd79c
<mask token>


def downgrade():
    op.alter_column('sys_menu', 'menu_url', existing_type=mysql.VARCHAR(
        charset='utf8mb4', collation='utf8mb4_unicode_ci', length=100),
        comment='请求地址,即访问后台接口的url', existing_comment='权限标识,即标识每一个操作权限',
        existing_nullable=False)
    op.create_table('vote_activity_manage', sa.Column('id', mysql.VARCHAR(
        charset='utf8mb4', collation='utf8mb4_unicode_ci', length=20),
        nullable=False, comment='主键ID'), sa.Column('state', mysql.SMALLINT(
        ), autoincrement=False, nullable=True, comment=
        '状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column('create_time', mysql.DATETIME(
        ), nullable=False, comment='创建时间'), sa.Column('create_by_id', mysql
        .BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'), sa
        .Column('last_change_time', mysql.DATETIME(), nullable=True,
        comment='最后修改的时间'), sa.Column('change_by_id', mysql.BIGINT(),
        autoincrement=False, nullable=True, comment='最后修改者ID'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='删除者id'), sa.Column('activity_name', mysql.
        VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=
        100), nullable=False, comment='活动名称'), sa.Column('activity_img',
        mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci',
        length=300), nullable=False, comment='活动图片'), sa.Column(
        'showcase_img', mysql.VARCHAR(charset='utf8mb4', collation=
        'utf8mb4_unicode_ci', length=300), nullable=False, comment='橱窗图'),
        sa.Column('bg_color', mysql.VARCHAR(charset='utf8mb4', collation=
        'utf8mb4_unicode_ci', length=30), nullable=True, comment='背景颜色'),
        sa.Column('limit_type', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='限制的方式,0为不限制,1为对账号限制,2为每天限制'), sa.Column(
        'limit_num', mysql.SMALLINT(), autoincrement=False, nullable=True,
        comment='对单用户限制的投票次数'), sa.Column('can_comment', mysql.TINYINT(
        display_width=1), autoincrement=False, nullable=True, comment=
        '投票后是否支持评论, 默认不支持'), sa.Column('vote_activity_type', mysql.SMALLINT
        (), autoincrement=False, nullable=True, comment=
        '投票后的游戏, 0为没有活动, 1为幸运大转盘, 2为幸运九宫格, 3为幸福刮刮乐, 4为答题有奖, 5为玩游戏有奖'), sa.
        Column('against_vote_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='反对的投票数量'), sa.Column('lottery_limit', mysql
        .TINYINT(display_width=1), autoincrement=False, nullable=True,
        comment='是否限制抽奖'), sa.Column('lottery_num', mysql.SMALLINT(),
        autoincrement=False, nullable=True, comment='一次投票活动中用户的抽奖次数限制'), sa
        .Column('lucky_draw_remarks', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=100), nullable=True, comment='抽奖备注'),
        sa.Column('support_vote_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='支持的投票数量'), sa.Column('end_date', sa.DATE(),
        nullable=False, comment='活动结束日期'), sa.Column('start_date', sa.DATE(
        ), nullable=False, comment='活动开始日期'), sa.CheckConstraint(
        '(`lottery_limit` in (0,1))', name='vote_activity_manage_chk_2'),
        sa.PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4', mysql_engine='InnoDB',
        mysql_row_format='DYNAMIC')
    op.create_index('ix_vote_activity_manage_state', 'vote_activity_manage',
        ['state'], unique=False)
    op.create_index('ix_vote_activity_manage_deleted_by_id',
        'vote_activity_manage', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_create_by_id',
        'vote_activity_manage', ['create_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_change_by_id',
        'vote_activity_manage', ['change_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_activity_name',
        'vote_activity_manage', ['activity_name'], unique=False)
    op.create_index('id', 'vote_activity_manage', ['id'], unique=True)
    op.create_table('vote_activity_player', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True,
        comment='最后修改者ID'), sa.Column('deleted_time', mysql.DATETIME(),
        nullable=True, comment='删除时间'), sa.Column('deleted_by_id', mysql.
        BIGINT(), autoincrement=False, nullable=True, comment='删除者id'), sa.
        Column('player_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=100), nullable=False, comment='选手姓名'), sa.Column(
        'player_img', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=
        300), nullable=False, comment='选手图片'), sa.Column('player_comment',
        mysql.TEXT(collation='utf8mb4_unicode_ci'), nullable=False, comment
        ='选手介绍'), sa.Column('player_speech', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=100), nullable=True, comment='选手感言'),
        sa.Column('activity_id', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=20), nullable=False, comment='投票活动ID'),
        sa.Column('support_vote_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='支持的投票数量'), sa.Column('against_vote_num',
        mysql.INTEGER(), autoincrement=False, nullable=True, comment=
        '反对的投票数量'), sa.PrimaryKeyConstraint('id'), mysql_collate=
        'utf8mb4_unicode_ci', mysql_default_charset='utf8mb4', mysql_engine
        ='InnoDB')
    op.create_index('ix_vote_activity_player_state', 'vote_activity_player',
        ['state'], unique=False)
    op.create_index('ix_vote_activity_player_player_name',
        'vote_activity_player', ['player_name'], unique=False)
    op.create_index('ix_vote_activity_player_deleted_by_id',
        'vote_activity_player', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_create_by_id',
        'vote_activity_player', ['create_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_change_by_id',
        'vote_activity_player', ['change_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_activity_id',
        'vote_activity_player', ['activity_id'], unique=False)
    op.create_index('id', 'vote_activity_player', ['id'], unique=True)
    op.create_table('vote_subscriber_gift', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('gift_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=20), nullable=False, comment='奖品ID'), sa.Column(
        'change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True,
        comment='最后修改者ID'), sa.Column('deleted_by_id', mysql.BIGINT(),
        autoincrement=False, nullable=True, comment='删除者id'), sa.
        PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4', mysql_engine='InnoDB')
    op.create_index('ix_vote_subscriber_gift_state', 'vote_subscriber_gift',
        ['state'], unique=False)
    op.create_index('ix_vote_subscriber_gift_gift_id',
        'vote_subscriber_gift', ['gift_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_deleted_by_id',
        'vote_subscriber_gift', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_create_by_id',
        'vote_subscriber_gift', ['create_by_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_change_by_id',
        'vote_subscriber_gift', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_subscriber_gift', ['id'], unique=True)
    op.create_table('vote_player_comment', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('player_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=20), nullable=False, comment='选手ID'), sa.Column('parent_id',
        mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=
        True, comment='评论者id自关联'), sa.Column('support_or_against', mysql.
        TINYINT(display_width=1), autoincrement=False, nullable=True,
        comment='支持还是反对'), sa.Column('comment', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=150), nullable=False, comment='评论'),
        sa.Column('support_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='点赞数'), sa.Column('change_by_id', mysql.
        BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
        sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='删除者id'), sa.CheckConstraint(
        '(`support_or_against` in (0,1))', name='vote_player_comment_chk_1'
        ), sa.PrimaryKeyConstraint('id'), mysql_collate=
        'utf8mb4_unicode_ci', mysql_default_charset='utf8mb4', mysql_engine
        ='InnoDB')
    op.create_index('ix_vote_player_comment_state', 'vote_player_comment',
        ['state'], unique=False)
    op.create_index('ix_vote_player_comment_player_id',
        'vote_player_comment', ['player_id'], unique=False)
    op.create_index('ix_vote_player_comment_deleted_by_id',
        'vote_player_comment', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_player_comment_create_by_id',
        'vote_player_comment', ['create_by_id'], unique=False)
    op.create_index('ix_vote_player_comment_change_by_id',
        'vote_player_comment', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_player_comment', ['id'], unique=True)
    op.create_table('vote_luck_draw_gift', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True,
        comment='最后修改者ID'), sa.Column('deleted_time', mysql.DATETIME(),
        nullable=True, comment='删除时间'), sa.Column('deleted_by_id', mysql.
        BIGINT(), autoincrement=False, nullable=True, comment='删除者id'), sa.
        Column('activity_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=20), nullable=False, comment='投票活动ID'), sa.Column(
        'gift_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=
        100), nullable=False, comment='奖品名称'), sa.Column('gift_img', mysql.
        VARCHAR(collation='utf8mb4_unicode_ci', length=300), nullable=True,
        comment='奖品相片'), sa.Column('winning_chance', mysql.FLOAT(),
        nullable=False, comment='中奖几率'), sa.PrimaryKeyConstraint('id'),
        mysql_collate='utf8mb4_unicode_ci', mysql_default_charset='utf8mb4',
        mysql_engine='InnoDB')
    op.create_index('ix_vote_luck_draw_gift_state', 'vote_luck_draw_gift',
        ['state'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_deleted_by_id',
        'vote_luck_draw_gift', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_create_by_id',
        'vote_luck_draw_gift', ['create_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_change_by_id',
        'vote_luck_draw_gift', ['change_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_activity_id',
        'vote_luck_draw_gift', ['activity_id'], unique=False)
    op.create_index('id', 'vote_luck_draw_gift', ['id'], unique=True)
    op.create_table('vote_comment_support', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('comment_id', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=20), nullable=False, comment='评论id'),
        sa.Column('subscriber_id', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=20), nullable=False, comment='点赞者id'),
        sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='最后修改者ID'), sa.Column('deleted_by_id', mysql
        .BIGINT(), autoincrement=False, nullable=True, comment='删除者id'), sa
        .PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4', mysql_engine='InnoDB')
    op.create_index('ix_vote_comment_support_subscriber_id',
        'vote_comment_support', ['subscriber_id'], unique=False)
    op.create_index('ix_vote_comment_support_state', 'vote_comment_support',
        ['state'], unique=False)
    op.create_index('ix_vote_comment_support_deleted_by_id',
        'vote_comment_support', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_comment_support_create_by_id',
        'vote_comment_support', ['create_by_id'], unique=False)
    op.create_index('ix_vote_comment_support_comment_id',
        'vote_comment_support', ['comment_id'], unique=False)
    op.create_index('ix_vote_comment_support_change_by_id',
        'vote_comment_support', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_comment_support', ['id'], unique=True)

<mask token>


def upgrade():
    op.drop_index('id', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_change_by_id', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_comment_id', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_create_by_id', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_deleted_by_id', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_state', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_subscriber_id', table_name=
        'vote_comment_support')
    op.drop_table('vote_comment_support')
    op.drop_index('id', table_name='vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_activity_id', table_name=
        'vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_change_by_id', table_name=
        'vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_create_by_id', table_name=
        'vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_deleted_by_id', table_name=
        'vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_state', table_name=
        'vote_luck_draw_gift')
    op.drop_table('vote_luck_draw_gift')
    op.drop_index('id', table_name='vote_player_comment')
    op.drop_index('ix_vote_player_comment_change_by_id', table_name=
        'vote_player_comment')
    op.drop_index('ix_vote_player_comment_create_by_id', table_name=
        'vote_player_comment')
    op.drop_index('ix_vote_player_comment_deleted_by_id', table_name=
        'vote_player_comment')
    op.drop_index('ix_vote_player_comment_player_id', table_name=
        'vote_player_comment')
    op.drop_index('ix_vote_player_comment_state', table_name=
        'vote_player_comment')
    op.drop_table('vote_player_comment')
    op.drop_index('id', table_name='vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_change_by_id', table_name=
        'vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_create_by_id', table_name=
        'vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_deleted_by_id', table_name=
        'vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_gift_id', table_name=
        'vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_state', table_name=
        'vote_subscriber_gift')
    op.drop_table('vote_subscriber_gift')
    op.drop_index('id', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_activity_id', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_change_by_id', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_create_by_id', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_deleted_by_id', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_player_name', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_state', table_name=
        'vote_activity_player')
    op.drop_table('vote_activity_player')
    op.drop_index('id', table_name='vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_activity_name', table_name=
        'vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_change_by_id', table_name=
        'vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_create_by_id', table_name=
        'vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_deleted_by_id', table_name=
        'vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_state', table_name=
        'vote_activity_manage')
    op.drop_table('vote_activity_manage')
    op.alter_column('sys_menu', 'menu_url', existing_type=mysql.VARCHAR(
        charset='utf8mb4', collation='utf8mb4_unicode_ci', length=100),
        comment='权限标识,即标识每一个操作权限', existing_comment='请求地址,即访问后台接口的url',
        existing_nullable=False)


def downgrade():
    op.alter_column('sys_menu', 'menu_url', existing_type=mysql.VARCHAR(
        charset='utf8mb4', collation='utf8mb4_unicode_ci', length=100),
        comment='请求地址,即访问后台接口的url', existing_comment='权限标识,即标识每一个操作权限',
        existing_nullable=False)
    op.create_table('vote_activity_manage', sa.Column('id', mysql.VARCHAR(
        charset='utf8mb4', collation='utf8mb4_unicode_ci', length=20),
        nullable=False, comment='主键ID'), sa.Column('state', mysql.SMALLINT(
        ), autoincrement=False, nullable=True, comment=
        '状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column('create_time', mysql.DATETIME(
        ), nullable=False, comment='创建时间'), sa.Column('create_by_id', mysql
        .BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'), sa
        .Column('last_change_time', mysql.DATETIME(), nullable=True,
        comment='最后修改的时间'), sa.Column('change_by_id', mysql.BIGINT(),
        autoincrement=False, nullable=True, comment='最后修改者ID'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='删除者id'), sa.Column('activity_name', mysql.
        VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=
        100), nullable=False, comment='活动名称'), sa.Column('activity_img',
        mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci',
        length=300), nullable=False, comment='活动图片'), sa.Column(
        'showcase_img', mysql.VARCHAR(charset='utf8mb4', collation=
        'utf8mb4_unicode_ci', length=300), nullable=False, comment='橱窗图'),
        sa.Column('bg_color', mysql.VARCHAR(charset='utf8mb4', collation=
        'utf8mb4_unicode_ci', length=30), nullable=True, comment='背景颜色'),
        sa.Column('limit_type', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='限制的方式,0为不限制,1为对账号限制,2为每天限制'), sa.Column(
        'limit_num', mysql.SMALLINT(), autoincrement=False, nullable=True,
        comment='对单用户限制的投票次数'), sa.Column('can_comment', mysql.TINYINT(
        display_width=1), autoincrement=False, nullable=True, comment=
        '投票后是否支持评论, 默认不支持'), sa.Column('vote_activity_type', mysql.SMALLINT
        (), autoincrement=False, nullable=True, comment=
        '投票后的游戏, 0为没有活动, 1为幸运大转盘, 2为幸运九宫格, 3为幸福刮刮乐, 4为答题有奖, 5为玩游戏有奖'), sa.
        Column('against_vote_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='反对的投票数量'), sa.Column('lottery_limit', mysql
        .TINYINT(display_width=1), autoincrement=False, nullable=True,
        comment='是否限制抽奖'), sa.Column('lottery_num', mysql.SMALLINT(),
        autoincrement=False, nullable=True, comment='一次投票活动中用户的抽奖次数限制'), sa
        .Column('lucky_draw_remarks', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=100), nullable=True, comment='抽奖备注'),
        sa.Column('support_vote_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='支持的投票数量'), sa.Column('end_date', sa.DATE(),
        nullable=False, comment='活动结束日期'), sa.Column('start_date', sa.DATE(
        ), nullable=False, comment='活动开始日期'), sa.CheckConstraint(
        '(`lottery_limit` in (0,1))', name='vote_activity_manage_chk_2'),
        sa.PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4', mysql_engine='InnoDB',
        mysql_row_format='DYNAMIC')
    op.create_index('ix_vote_activity_manage_state', 'vote_activity_manage',
        ['state'], unique=False)
    op.create_index('ix_vote_activity_manage_deleted_by_id',
        'vote_activity_manage', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_create_by_id',
        'vote_activity_manage', ['create_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_change_by_id',
        'vote_activity_manage', ['change_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_activity_name',
        'vote_activity_manage', ['activity_name'], unique=False)
    op.create_index('id', 'vote_activity_manage', ['id'], unique=True)
    op.create_table('vote_activity_player', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True,
        comment='最后修改者ID'), sa.Column('deleted_time', mysql.DATETIME(),
        nullable=True, comment='删除时间'), sa.Column('deleted_by_id', mysql.
        BIGINT(), autoincrement=False, nullable=True, comment='删除者id'), sa.
        Column('player_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=100), nullable=False, comment='选手姓名'), sa.Column(
        'player_img', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=
        300), nullable=False, comment='选手图片'), sa.Column('player_comment',
        mysql.TEXT(collation='utf8mb4_unicode_ci'), nullable=False, comment
        ='选手介绍'), sa.Column('player_speech', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=100), nullable=True, comment='选手感言'),
        sa.Column('activity_id', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=20), nullable=False, comment='投票活动ID'),
        sa.Column('support_vote_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='支持的投票数量'), sa.Column('against_vote_num',
        mysql.INTEGER(), autoincrement=False, nullable=True, comment=
        '反对的投票数量'), sa.PrimaryKeyConstraint('id'), mysql_collate=
        'utf8mb4_unicode_ci', mysql_default_charset='utf8mb4', mysql_engine
        ='InnoDB')
    op.create_index('ix_vote_activity_player_state', 'vote_activity_player',
        ['state'], unique=False)
    op.create_index('ix_vote_activity_player_player_name',
        'vote_activity_player', ['player_name'], unique=False)
    op.create_index('ix_vote_activity_player_deleted_by_id',
        'vote_activity_player', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_create_by_id',
        'vote_activity_player', ['create_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_change_by_id',
        'vote_activity_player', ['change_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_activity_id',
        'vote_activity_player', ['activity_id'], unique=False)
    op.create_index('id', 'vote_activity_player', ['id'], unique=True)
    op.create_table('vote_subscriber_gift', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('gift_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=20), nullable=False, comment='奖品ID'), sa.Column(
        'change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True,
        comment='最后修改者ID'), sa.Column('deleted_by_id', mysql.BIGINT(),
        autoincrement=False, nullable=True, comment='删除者id'), sa.
        PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4', mysql_engine='InnoDB')
    op.create_index('ix_vote_subscriber_gift_state', 'vote_subscriber_gift',
        ['state'], unique=False)
    op.create_index('ix_vote_subscriber_gift_gift_id',
        'vote_subscriber_gift', ['gift_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_deleted_by_id',
        'vote_subscriber_gift', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_create_by_id',
        'vote_subscriber_gift', ['create_by_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_change_by_id',
        'vote_subscriber_gift', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_subscriber_gift', ['id'], unique=True)
    op.create_table('vote_player_comment', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('player_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=20), nullable=False, comment='选手ID'), sa.Column('parent_id',
        mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=
        True, comment='评论者id自关联'), sa.Column('support_or_against', mysql.
        TINYINT(display_width=1), autoincrement=False, nullable=True,
        comment='支持还是反对'), sa.Column('comment', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=150), nullable=False, comment='评论'),
        sa.Column('support_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='点赞数'), sa.Column('change_by_id', mysql.
        BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
        sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='删除者id'), sa.CheckConstraint(
        '(`support_or_against` in (0,1))', name='vote_player_comment_chk_1'
        ), sa.PrimaryKeyConstraint('id'), mysql_collate=
        'utf8mb4_unicode_ci', mysql_default_charset='utf8mb4', mysql_engine
        ='InnoDB')
    op.create_index('ix_vote_player_comment_state', 'vote_player_comment',
        ['state'], unique=False)
    op.create_index('ix_vote_player_comment_player_id',
        'vote_player_comment', ['player_id'], unique=False)
    op.create_index('ix_vote_player_comment_deleted_by_id',
        'vote_player_comment', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_player_comment_create_by_id',
        'vote_player_comment', ['create_by_id'], unique=False)
    op.create_index('ix_vote_player_comment_change_by_id',
        'vote_player_comment', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_player_comment', ['id'], unique=True)
    op.create_table('vote_luck_draw_gift', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True,
        comment='最后修改者ID'), sa.Column('deleted_time', mysql.DATETIME(),
        nullable=True, comment='删除时间'), sa.Column('deleted_by_id', mysql.
        BIGINT(), autoincrement=False, nullable=True, comment='删除者id'), sa.
        Column('activity_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=20), nullable=False, comment='投票活动ID'), sa.Column(
        'gift_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=
        100), nullable=False, comment='奖品名称'), sa.Column('gift_img', mysql.
        VARCHAR(collation='utf8mb4_unicode_ci', length=300), nullable=True,
        comment='奖品相片'), sa.Column('winning_chance', mysql.FLOAT(),
        nullable=False, comment='中奖几率'), sa.PrimaryKeyConstraint('id'),
        mysql_collate='utf8mb4_unicode_ci', mysql_default_charset='utf8mb4',
        mysql_engine='InnoDB')
    op.create_index('ix_vote_luck_draw_gift_state', 'vote_luck_draw_gift',
        ['state'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_deleted_by_id',
        'vote_luck_draw_gift', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_create_by_id',
        'vote_luck_draw_gift', ['create_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_change_by_id',
        'vote_luck_draw_gift', ['change_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_activity_id',
        'vote_luck_draw_gift', ['activity_id'], unique=False)
    op.create_index('id', 'vote_luck_draw_gift', ['id'], unique=True)
    op.create_table('vote_comment_support', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('comment_id', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=20), nullable=False, comment='评论id'),
        sa.Column('subscriber_id', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=20), nullable=False, comment='点赞者id'),
        sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='最后修改者ID'), sa.Column('deleted_by_id', mysql
        .BIGINT(), autoincrement=False, nullable=True, comment='删除者id'), sa
        .PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4', mysql_engine='InnoDB')
    op.create_index('ix_vote_comment_support_subscriber_id',
        'vote_comment_support', ['subscriber_id'], unique=False)
    op.create_index('ix_vote_comment_support_state', 'vote_comment_support',
        ['state'], unique=False)
    op.create_index('ix_vote_comment_support_deleted_by_id',
        'vote_comment_support', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_comment_support_create_by_id',
        'vote_comment_support', ['create_by_id'], unique=False)
    op.create_index('ix_vote_comment_support_comment_id',
        'vote_comment_support', ['comment_id'], unique=False)
    op.create_index('ix_vote_comment_support_change_by_id',
        'vote_comment_support', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_comment_support', ['id'], unique=True)

<mask token>
revision = '3b69c0d9e66e'
down_revision = '8a6ec38d52ce'
branch_labels = None
depends_on = None


def upgrade():
    op.drop_index('id', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_change_by_id', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_comment_id', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_create_by_id', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_deleted_by_id', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_state', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_subscriber_id', table_name=
        'vote_comment_support')
    op.drop_table('vote_comment_support')
    op.drop_index('id', table_name='vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_activity_id', table_name=
        'vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_change_by_id', table_name=
        'vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_create_by_id', table_name=
        'vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_deleted_by_id', table_name=
        'vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_state', table_name=
        'vote_luck_draw_gift')
    op.drop_table('vote_luck_draw_gift')
    op.drop_index('id', table_name='vote_player_comment')
    op.drop_index('ix_vote_player_comment_change_by_id', table_name=
        'vote_player_comment')
    op.drop_index('ix_vote_player_comment_create_by_id', table_name=
        'vote_player_comment')
    op.drop_index('ix_vote_player_comment_deleted_by_id', table_name=
        'vote_player_comment')
    op.drop_index('ix_vote_player_comment_player_id', table_name=
        'vote_player_comment')
    op.drop_index('ix_vote_player_comment_state', table_name=
        'vote_player_comment')
    op.drop_table('vote_player_comment')
    op.drop_index('id', table_name='vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_change_by_id', table_name=
        'vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_create_by_id', table_name=
        'vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_deleted_by_id', table_name=
        'vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_gift_id', table_name=
        'vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_state', table_name=
        'vote_subscriber_gift')
    op.drop_table('vote_subscriber_gift')
    op.drop_index('id', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_activity_id', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_change_by_id', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_create_by_id', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_deleted_by_id', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_player_name', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_state', table_name=
        'vote_activity_player')
    op.drop_table('vote_activity_player')
    op.drop_index('id', table_name='vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_activity_name', table_name=
        'vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_change_by_id', table_name=
        'vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_create_by_id', table_name=
        'vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_deleted_by_id', table_name=
        'vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_state', table_name=
        'vote_activity_manage')
    op.drop_table('vote_activity_manage')
    op.alter_column('sys_menu', 'menu_url', existing_type=mysql.VARCHAR(
        charset='utf8mb4', collation='utf8mb4_unicode_ci', length=100),
        comment='权限标识,即标识每一个操作权限', existing_comment='请求地址,即访问后台接口的url',
        existing_nullable=False)


def downgrade():
    op.alter_column('sys_menu', 'menu_url', existing_type=mysql.VARCHAR(
        charset='utf8mb4', collation='utf8mb4_unicode_ci', length=100),
        comment='请求地址,即访问后台接口的url', existing_comment='权限标识,即标识每一个操作权限',
        existing_nullable=False)
    op.create_table('vote_activity_manage', sa.Column('id', mysql.VARCHAR(
        charset='utf8mb4', collation='utf8mb4_unicode_ci', length=20),
        nullable=False, comment='主键ID'), sa.Column('state', mysql.SMALLINT(
        ), autoincrement=False, nullable=True, comment=
        '状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column('create_time', mysql.DATETIME(
        ), nullable=False, comment='创建时间'), sa.Column('create_by_id', mysql
        .BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'), sa
        .Column('last_change_time', mysql.DATETIME(), nullable=True,
        comment='最后修改的时间'), sa.Column('change_by_id', mysql.BIGINT(),
        autoincrement=False, nullable=True, comment='最后修改者ID'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='删除者id'), sa.Column('activity_name', mysql.
        VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=
        100), nullable=False, comment='活动名称'), sa.Column('activity_img',
        mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci',
        length=300), nullable=False, comment='活动图片'), sa.Column(
        'showcase_img', mysql.VARCHAR(charset='utf8mb4', collation=
        'utf8mb4_unicode_ci', length=300), nullable=False, comment='橱窗图'),
        sa.Column('bg_color', mysql.VARCHAR(charset='utf8mb4', collation=
        'utf8mb4_unicode_ci', length=30), nullable=True, comment='背景颜色'),
        sa.Column('limit_type', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='限制的方式,0为不限制,1为对账号限制,2为每天限制'), sa.Column(
        'limit_num', mysql.SMALLINT(), autoincrement=False, nullable=True,
        comment='对单用户限制的投票次数'), sa.Column('can_comment', mysql.TINYINT(
        display_width=1), autoincrement=False, nullable=True, comment=
        '投票后是否支持评论, 默认不支持'), sa.Column('vote_activity_type', mysql.SMALLINT
        (), autoincrement=False, nullable=True, comment=
        '投票后的游戏, 0为没有活动, 1为幸运大转盘, 2为幸运九宫格, 3为幸福刮刮乐, 4为答题有奖, 5为玩游戏有奖'), sa.
        Column('against_vote_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='反对的投票数量'), sa.Column('lottery_limit', mysql
        .TINYINT(display_width=1), autoincrement=False, nullable=True,
        comment='是否限制抽奖'), sa.Column('lottery_num', mysql.SMALLINT(),
        autoincrement=False, nullable=True, comment='一次投票活动中用户的抽奖次数限制'), sa
        .Column('lucky_draw_remarks', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=100), nullable=True, comment='抽奖备注'),
        sa.Column('support_vote_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='支持的投票数量'), sa.Column('end_date', sa.DATE(),
        nullable=False, comment='活动结束日期'), sa.Column('start_date', sa.DATE(
        ), nullable=False, comment='活动开始日期'), sa.CheckConstraint(
        '(`lottery_limit` in (0,1))', name='vote_activity_manage_chk_2'),
        sa.PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4', mysql_engine='InnoDB',
        mysql_row_format='DYNAMIC')
    op.create_index('ix_vote_activity_manage_state', 'vote_activity_manage',
        ['state'], unique=False)
    op.create_index('ix_vote_activity_manage_deleted_by_id',
        'vote_activity_manage', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_create_by_id',
        'vote_activity_manage', ['create_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_change_by_id',
        'vote_activity_manage', ['change_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_activity_name',
        'vote_activity_manage', ['activity_name'], unique=False)
    op.create_index('id', 'vote_activity_manage', ['id'], unique=True)
    op.create_table('vote_activity_player', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True,
        comment='最后修改者ID'), sa.Column('deleted_time', mysql.DATETIME(),
        nullable=True, comment='删除时间'), sa.Column('deleted_by_id', mysql.
        BIGINT(), autoincrement=False, nullable=True, comment='删除者id'), sa.
        Column('player_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=100), nullable=False, comment='选手姓名'), sa.Column(
        'player_img', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=
        300), nullable=False, comment='选手图片'), sa.Column('player_comment',
        mysql.TEXT(collation='utf8mb4_unicode_ci'), nullable=False, comment
        ='选手介绍'), sa.Column('player_speech', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=100), nullable=True, comment='选手感言'),
        sa.Column('activity_id', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=20), nullable=False, comment='投票活动ID'),
        sa.Column('support_vote_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='支持的投票数量'), sa.Column('against_vote_num',
        mysql.INTEGER(), autoincrement=False, nullable=True, comment=
        '反对的投票数量'), sa.PrimaryKeyConstraint('id'), mysql_collate=
        'utf8mb4_unicode_ci', mysql_default_charset='utf8mb4', mysql_engine
        ='InnoDB')
    op.create_index('ix_vote_activity_player_state', 'vote_activity_player',
        ['state'], unique=False)
    op.create_index('ix_vote_activity_player_player_name',
        'vote_activity_player', ['player_name'], unique=False)
    op.create_index('ix_vote_activity_player_deleted_by_id',
        'vote_activity_player', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_create_by_id',
        'vote_activity_player', ['create_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_change_by_id',
        'vote_activity_player', ['change_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_activity_id',
        'vote_activity_player', ['activity_id'], unique=False)
    op.create_index('id', 'vote_activity_player', ['id'], unique=True)
    op.create_table('vote_subscriber_gift', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('gift_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=20), nullable=False, comment='奖品ID'), sa.Column(
        'change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True,
        comment='最后修改者ID'), sa.Column('deleted_by_id', mysql.BIGINT(),
        autoincrement=False, nullable=True, comment='删除者id'), sa.
        PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4', mysql_engine='InnoDB')
    op.create_index('ix_vote_subscriber_gift_state', 'vote_subscriber_gift',
        ['state'], unique=False)
    op.create_index('ix_vote_subscriber_gift_gift_id',
        'vote_subscriber_gift', ['gift_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_deleted_by_id',
        'vote_subscriber_gift', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_create_by_id',
        'vote_subscriber_gift', ['create_by_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_change_by_id',
        'vote_subscriber_gift', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_subscriber_gift', ['id'], unique=True)
    op.create_table('vote_player_comment', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('player_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=20), nullable=False, comment='选手ID'), sa.Column('parent_id',
        mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=
        True, comment='评论者id自关联'), sa.Column('support_or_against', mysql.
        TINYINT(display_width=1), autoincrement=False, nullable=True,
        comment='支持还是反对'), sa.Column('comment', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=150), nullable=False, comment='评论'),
        sa.Column('support_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='点赞数'), sa.Column('change_by_id', mysql.
        BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
        sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='删除者id'), sa.CheckConstraint(
        '(`support_or_against` in (0,1))', name='vote_player_comment_chk_1'
        ), sa.PrimaryKeyConstraint('id'), mysql_collate=
        'utf8mb4_unicode_ci', mysql_default_charset='utf8mb4', mysql_engine
        ='InnoDB')
    op.create_index('ix_vote_player_comment_state', 'vote_player_comment',
        ['state'], unique=False)
    op.create_index('ix_vote_player_comment_player_id',
        'vote_player_comment', ['player_id'], unique=False)
    op.create_index('ix_vote_player_comment_deleted_by_id',
        'vote_player_comment', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_player_comment_create_by_id',
        'vote_player_comment', ['create_by_id'], unique=False)
    op.create_index('ix_vote_player_comment_change_by_id',
        'vote_player_comment', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_player_comment', ['id'], unique=True)
    op.create_table('vote_luck_draw_gift', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True,
        comment='最后修改者ID'), sa.Column('deleted_time', mysql.DATETIME(),
        nullable=True, comment='删除时间'), sa.Column('deleted_by_id', mysql.
        BIGINT(), autoincrement=False, nullable=True, comment='删除者id'), sa.
        Column('activity_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=20), nullable=False, comment='投票活动ID'), sa.Column(
        'gift_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=
        100), nullable=False, comment='奖品名称'), sa.Column('gift_img', mysql.
        VARCHAR(collation='utf8mb4_unicode_ci', length=300), nullable=True,
        comment='奖品相片'), sa.Column('winning_chance', mysql.FLOAT(),
        nullable=False, comment='中奖几率'), sa.PrimaryKeyConstraint('id'),
        mysql_collate='utf8mb4_unicode_ci', mysql_default_charset='utf8mb4',
        mysql_engine='InnoDB')
    op.create_index('ix_vote_luck_draw_gift_state', 'vote_luck_draw_gift',
        ['state'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_deleted_by_id',
        'vote_luck_draw_gift', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_create_by_id',
        'vote_luck_draw_gift', ['create_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_change_by_id',
        'vote_luck_draw_gift', ['change_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_activity_id',
        'vote_luck_draw_gift', ['activity_id'], unique=False)
    op.create_index('id', 'vote_luck_draw_gift', ['id'], unique=True)
    op.create_table('vote_comment_support', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('comment_id', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=20), nullable=False, comment='评论id'),
        sa.Column('subscriber_id', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=20), nullable=False, comment='点赞者id'),
        sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='最后修改者ID'), sa.Column('deleted_by_id', mysql
        .BIGINT(), autoincrement=False, nullable=True, comment='删除者id'), sa
        .PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4', mysql_engine='InnoDB')
    op.create_index('ix_vote_comment_support_subscriber_id',
        'vote_comment_support', ['subscriber_id'], unique=False)
    op.create_index('ix_vote_comment_support_state', 'vote_comment_support',
        ['state'], unique=False)
    op.create_index('ix_vote_comment_support_deleted_by_id',
        'vote_comment_support', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_comment_support_create_by_id',
        'vote_comment_support', ['create_by_id'], unique=False)
    op.create_index('ix_vote_comment_support_comment_id',
        'vote_comment_support', ['comment_id'], unique=False)
    op.create_index('ix_vote_comment_support_change_by_id',
        'vote_comment_support', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_comment_support', ['id'], unique=True)

<mask token>
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
revision = '3b69c0d9e66e'
down_revision = '8a6ec38d52ce'
branch_labels = None
depends_on = None


def upgrade():
    op.drop_index('id', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_change_by_id', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_comment_id', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_create_by_id', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_deleted_by_id', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_state', table_name=
        'vote_comment_support')
    op.drop_index('ix_vote_comment_support_subscriber_id', table_name=
        'vote_comment_support')
    op.drop_table('vote_comment_support')
    op.drop_index('id', table_name='vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_activity_id', table_name=
        'vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_change_by_id', table_name=
        'vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_create_by_id', table_name=
        'vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_deleted_by_id', table_name=
        'vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_state', table_name=
        'vote_luck_draw_gift')
    op.drop_table('vote_luck_draw_gift')
    op.drop_index('id', table_name='vote_player_comment')
    op.drop_index('ix_vote_player_comment_change_by_id', table_name=
        'vote_player_comment')
    op.drop_index('ix_vote_player_comment_create_by_id', table_name=
        'vote_player_comment')
    op.drop_index('ix_vote_player_comment_deleted_by_id', table_name=
        'vote_player_comment')
    op.drop_index('ix_vote_player_comment_player_id', table_name=
        'vote_player_comment')
    op.drop_index('ix_vote_player_comment_state', table_name=
        'vote_player_comment')
    op.drop_table('vote_player_comment')
    op.drop_index('id', table_name='vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_change_by_id', table_name=
        'vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_create_by_id', table_name=
        'vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_deleted_by_id', table_name=
        'vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_gift_id', table_name=
        'vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_state', table_name=
        'vote_subscriber_gift')
    op.drop_table('vote_subscriber_gift')
    op.drop_index('id', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_activity_id', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_change_by_id', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_create_by_id', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_deleted_by_id', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_player_name', table_name=
        'vote_activity_player')
    op.drop_index('ix_vote_activity_player_state', table_name=
        'vote_activity_player')
    op.drop_table('vote_activity_player')
    op.drop_index('id', table_name='vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_activity_name', table_name=
        'vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_change_by_id', table_name=
        'vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_create_by_id', table_name=
        'vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_deleted_by_id', table_name=
        'vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_state', table_name=
        'vote_activity_manage')
    op.drop_table('vote_activity_manage')
    op.alter_column('sys_menu', 'menu_url', existing_type=mysql.VARCHAR(
        charset='utf8mb4', collation='utf8mb4_unicode_ci', length=100),
        comment='权限标识,即标识每一个操作权限', existing_comment='请求地址,即访问后台接口的url',
        existing_nullable=False)


def downgrade():
    op.alter_column('sys_menu', 'menu_url', existing_type=mysql.VARCHAR(
        charset='utf8mb4', collation='utf8mb4_unicode_ci', length=100),
        comment='请求地址,即访问后台接口的url', existing_comment='权限标识,即标识每一个操作权限',
        existing_nullable=False)
    op.create_table('vote_activity_manage', sa.Column('id', mysql.VARCHAR(
        charset='utf8mb4', collation='utf8mb4_unicode_ci', length=20),
        nullable=False, comment='主键ID'), sa.Column('state', mysql.SMALLINT(
        ), autoincrement=False, nullable=True, comment=
        '状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column('create_time', mysql.DATETIME(
        ), nullable=False, comment='创建时间'), sa.Column('create_by_id', mysql
        .BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'), sa
        .Column('last_change_time', mysql.DATETIME(), nullable=True,
        comment='最后修改的时间'), sa.Column('change_by_id', mysql.BIGINT(),
        autoincrement=False, nullable=True, comment='最后修改者ID'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='删除者id'), sa.Column('activity_name', mysql.
        VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=
        100), nullable=False, comment='活动名称'), sa.Column('activity_img',
        mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci',
        length=300), nullable=False, comment='活动图片'), sa.Column(
        'showcase_img', mysql.VARCHAR(charset='utf8mb4', collation=
        'utf8mb4_unicode_ci', length=300), nullable=False, comment='橱窗图'),
        sa.Column('bg_color', mysql.VARCHAR(charset='utf8mb4', collation=
        'utf8mb4_unicode_ci', length=30), nullable=True, comment='背景颜色'),
        sa.Column('limit_type', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='限制的方式,0为不限制,1为对账号限制,2为每天限制'), sa.Column(
        'limit_num', mysql.SMALLINT(), autoincrement=False, nullable=True,
        comment='对单用户限制的投票次数'), sa.Column('can_comment', mysql.TINYINT(
        display_width=1), autoincrement=False, nullable=True, comment=
        '投票后是否支持评论, 默认不支持'), sa.Column('vote_activity_type', mysql.SMALLINT
        (), autoincrement=False, nullable=True, comment=
        '投票后的游戏, 0为没有活动, 1为幸运大转盘, 2为幸运九宫格, 3为幸福刮刮乐, 4为答题有奖, 5为玩游戏有奖'), sa.
        Column('against_vote_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='反对的投票数量'), sa.Column('lottery_limit', mysql
        .TINYINT(display_width=1), autoincrement=False, nullable=True,
        comment='是否限制抽奖'), sa.Column('lottery_num', mysql.SMALLINT(),
        autoincrement=False, nullable=True, comment='一次投票活动中用户的抽奖次数限制'), sa
        .Column('lucky_draw_remarks', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=100), nullable=True, comment='抽奖备注'),
        sa.Column('support_vote_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='支持的投票数量'), sa.Column('end_date', sa.DATE(),
        nullable=False, comment='活动结束日期'), sa.Column('start_date', sa.DATE(
        ), nullable=False, comment='活动开始日期'), sa.CheckConstraint(
        '(`lottery_limit` in (0,1))', name='vote_activity_manage_chk_2'),
        sa.PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4', mysql_engine='InnoDB',
        mysql_row_format='DYNAMIC')
    op.create_index('ix_vote_activity_manage_state', 'vote_activity_manage',
        ['state'], unique=False)
    op.create_index('ix_vote_activity_manage_deleted_by_id',
        'vote_activity_manage', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_create_by_id',
        'vote_activity_manage', ['create_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_change_by_id',
        'vote_activity_manage', ['change_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_activity_name',
        'vote_activity_manage', ['activity_name'], unique=False)
    op.create_index('id', 'vote_activity_manage', ['id'], unique=True)
    op.create_table('vote_activity_player', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True,
        comment='最后修改者ID'), sa.Column('deleted_time', mysql.DATETIME(),
        nullable=True, comment='删除时间'), sa.Column('deleted_by_id', mysql.
        BIGINT(), autoincrement=False, nullable=True, comment='删除者id'), sa.
        Column('player_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=100), nullable=False, comment='选手姓名'), sa.Column(
        'player_img', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=
        300), nullable=False, comment='选手图片'), sa.Column('player_comment',
        mysql.TEXT(collation='utf8mb4_unicode_ci'), nullable=False, comment
        ='选手介绍'), sa.Column('player_speech', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=100), nullable=True, comment='选手感言'),
        sa.Column('activity_id', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=20), nullable=False, comment='投票活动ID'),
        sa.Column('support_vote_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='支持的投票数量'), sa.Column('against_vote_num',
        mysql.INTEGER(), autoincrement=False, nullable=True, comment=
        '反对的投票数量'), sa.PrimaryKeyConstraint('id'), mysql_collate=
        'utf8mb4_unicode_ci', mysql_default_charset='utf8mb4', mysql_engine
        ='InnoDB')
    op.create_index('ix_vote_activity_player_state', 'vote_activity_player',
        ['state'], unique=False)
    op.create_index('ix_vote_activity_player_player_name',
        'vote_activity_player', ['player_name'], unique=False)
    op.create_index('ix_vote_activity_player_deleted_by_id',
        'vote_activity_player', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_create_by_id',
        'vote_activity_player', ['create_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_change_by_id',
        'vote_activity_player', ['change_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_activity_id',
        'vote_activity_player', ['activity_id'], unique=False)
    op.create_index('id', 'vote_activity_player', ['id'], unique=True)
    op.create_table('vote_subscriber_gift', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('gift_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=20), nullable=False, comment='奖品ID'), sa.Column(
        'change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True,
        comment='最后修改者ID'), sa.Column('deleted_by_id', mysql.BIGINT(),
        autoincrement=False, nullable=True, comment='删除者id'), sa.
        PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4', mysql_engine='InnoDB')
    op.create_index('ix_vote_subscriber_gift_state', 'vote_subscriber_gift',
        ['state'], unique=False)
    op.create_index('ix_vote_subscriber_gift_gift_id',
        'vote_subscriber_gift', ['gift_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_deleted_by_id',
        'vote_subscriber_gift', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_create_by_id',
        'vote_subscriber_gift', ['create_by_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_change_by_id',
        'vote_subscriber_gift', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_subscriber_gift', ['id'], unique=True)
    op.create_table('vote_player_comment', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('player_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=20), nullable=False, comment='选手ID'), sa.Column('parent_id',
        mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=
        True, comment='评论者id自关联'), sa.Column('support_or_against', mysql.
        TINYINT(display_width=1), autoincrement=False, nullable=True,
        comment='支持还是反对'), sa.Column('comment', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=150), nullable=False, comment='评论'),
        sa.Column('support_num', mysql.INTEGER(), autoincrement=False,
        nullable=True, comment='点赞数'), sa.Column('change_by_id', mysql.
        BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
        sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='删除者id'), sa.CheckConstraint(
        '(`support_or_against` in (0,1))', name='vote_player_comment_chk_1'
        ), sa.PrimaryKeyConstraint('id'), mysql_collate=
        'utf8mb4_unicode_ci', mysql_default_charset='utf8mb4', mysql_engine
        ='InnoDB')
    op.create_index('ix_vote_player_comment_state', 'vote_player_comment',
        ['state'], unique=False)
    op.create_index('ix_vote_player_comment_player_id',
        'vote_player_comment', ['player_id'], unique=False)
    op.create_index('ix_vote_player_comment_deleted_by_id',
        'vote_player_comment', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_player_comment_create_by_id',
        'vote_player_comment', ['create_by_id'], unique=False)
    op.create_index('ix_vote_player_comment_change_by_id',
        'vote_player_comment', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_player_comment', ['id'], unique=True)
    op.create_table('vote_luck_draw_gift', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True,
        comment='最后修改者ID'), sa.Column('deleted_time', mysql.DATETIME(),
        nullable=True, comment='删除时间'), sa.Column('deleted_by_id', mysql.
        BIGINT(), autoincrement=False, nullable=True, comment='删除者id'), sa.
        Column('activity_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci',
        length=20), nullable=False, comment='投票活动ID'), sa.Column(
        'gift_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=
        100), nullable=False, comment='奖品名称'), sa.Column('gift_img', mysql.
        VARCHAR(collation='utf8mb4_unicode_ci', length=300), nullable=True,
        comment='奖品相片'), sa.Column('winning_chance', mysql.FLOAT(),
        nullable=False, comment='中奖几率'), sa.PrimaryKeyConstraint('id'),
        mysql_collate='utf8mb4_unicode_ci', mysql_default_charset='utf8mb4',
        mysql_engine='InnoDB')
    op.create_index('ix_vote_luck_draw_gift_state', 'vote_luck_draw_gift',
        ['state'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_deleted_by_id',
        'vote_luck_draw_gift', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_create_by_id',
        'vote_luck_draw_gift', ['create_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_change_by_id',
        'vote_luck_draw_gift', ['change_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_activity_id',
        'vote_luck_draw_gift', ['activity_id'], unique=False)
    op.create_index('id', 'vote_luck_draw_gift', ['id'], unique=True)
    op.create_table('vote_comment_support', sa.Column('id', mysql.VARCHAR(
        collation='utf8mb4_unicode_ci', length=20), nullable=False, comment
        ='主键ID'), sa.Column('state', mysql.SMALLINT(), autoincrement=False,
        nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'), sa.Column(
        'create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
        sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='创建者ID'), sa.Column('last_change_time',
        mysql.DATETIME(), nullable=True, comment='最后修改的时间'), sa.Column(
        'deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
        sa.Column('comment_id', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=20), nullable=False, comment='评论id'),
        sa.Column('subscriber_id', mysql.VARCHAR(collation=
        'utf8mb4_unicode_ci', length=20), nullable=False, comment='点赞者id'),
        sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False,
        nullable=True, comment='最后修改者ID'), sa.Column('deleted_by_id', mysql
        .BIGINT(), autoincrement=False, nullable=True, comment='删除者id'), sa
        .PrimaryKeyConstraint('id'), mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4', mysql_engine='InnoDB')
    op.create_index('ix_vote_comment_support_subscriber_id',
        'vote_comment_support', ['subscriber_id'], unique=False)
    op.create_index('ix_vote_comment_support_state', 'vote_comment_support',
        ['state'], unique=False)
    op.create_index('ix_vote_comment_support_deleted_by_id',
        'vote_comment_support', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_comment_support_create_by_id',
        'vote_comment_support', ['create_by_id'], unique=False)
    op.create_index('ix_vote_comment_support_comment_id',
        'vote_comment_support', ['comment_id'], unique=False)
    op.create_index('ix_vote_comment_support_change_by_id',
        'vote_comment_support', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_comment_support', ['id'], unique=True)

"""empty message

Revision ID: 3b69c0d9e66e
Revises: 8a6ec38d52ce
Create Date: 2020-10-24 18:12:06.854281

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

# revision identifiers, used by Alembic.
revision = '3b69c0d9e66e'
down_revision = '8a6ec38d52ce'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('id', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_change_by_id', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_comment_id', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_create_by_id', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_deleted_by_id', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_state', table_name='vote_comment_support')
    op.drop_index('ix_vote_comment_support_subscriber_id', table_name='vote_comment_support')
    op.drop_table('vote_comment_support')
    op.drop_index('id', table_name='vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_activity_id', table_name='vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_change_by_id', table_name='vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_create_by_id', table_name='vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_deleted_by_id', table_name='vote_luck_draw_gift')
    op.drop_index('ix_vote_luck_draw_gift_state', table_name='vote_luck_draw_gift')
    op.drop_table('vote_luck_draw_gift')
    op.drop_index('id', table_name='vote_player_comment')
    op.drop_index('ix_vote_player_comment_change_by_id', table_name='vote_player_comment')
    op.drop_index('ix_vote_player_comment_create_by_id', table_name='vote_player_comment')
    op.drop_index('ix_vote_player_comment_deleted_by_id', table_name='vote_player_comment')
    op.drop_index('ix_vote_player_comment_player_id', table_name='vote_player_comment')
    op.drop_index('ix_vote_player_comment_state', table_name='vote_player_comment')
    op.drop_table('vote_player_comment')
    op.drop_index('id', table_name='vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_change_by_id', table_name='vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_create_by_id', table_name='vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_deleted_by_id', table_name='vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_gift_id', table_name='vote_subscriber_gift')
    op.drop_index('ix_vote_subscriber_gift_state', table_name='vote_subscriber_gift')
    op.drop_table('vote_subscriber_gift')
    op.drop_index('id', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_activity_id', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_change_by_id', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_create_by_id', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_deleted_by_id', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_player_name', table_name='vote_activity_player')
    op.drop_index('ix_vote_activity_player_state', table_name='vote_activity_player')
    op.drop_table('vote_activity_player')
    op.drop_index('id', table_name='vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_activity_name', table_name='vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_change_by_id', table_name='vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_create_by_id', table_name='vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_deleted_by_id', table_name='vote_activity_manage')
    op.drop_index('ix_vote_activity_manage_state', table_name='vote_activity_manage')
    op.drop_table('vote_activity_manage')
    op.alter_column('sys_menu', 'menu_url',
               existing_type=mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=100),
               comment='权限标识,即标识每一个操作权限',
               existing_comment='请求地址,即访问后台接口的url',
               existing_nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('sys_menu', 'menu_url',
               existing_type=mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=100),
               comment='请求地址,即访问后台接口的url',
               existing_comment='权限标识,即标识每一个操作权限',
               existing_nullable=False)
    op.create_table('vote_activity_manage',
    sa.Column('id', mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='主键ID'),
    sa.Column('state', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'),
    sa.Column('create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
    sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'),
    sa.Column('last_change_time', mysql.DATETIME(), nullable=True, comment='最后修改的时间'),
    sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
    sa.Column('deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
    sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='删除者id'),
    sa.Column('activity_name', mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=100), nullable=False, comment='活动名称'),
    sa.Column('activity_img', mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=300), nullable=False, comment='活动图片'),
    sa.Column('showcase_img', mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=300), nullable=False, comment='橱窗图'),
    sa.Column('bg_color', mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_unicode_ci', length=30), nullable=True, comment='背景颜色'),
    sa.Column('limit_type', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='限制的方式,0为不限制,1为对账号限制,2为每天限制'),
    sa.Column('limit_num', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='对单用户限制的投票次数'),
    sa.Column('can_comment', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True, comment='投票后是否支持评论, 默认不支持'),
    sa.Column('vote_activity_type', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='投票后的游戏, 0为没有活动, 1为幸运大转盘, 2为幸运九宫格, 3为幸福刮刮乐, 4为答题有奖, 5为玩游戏有奖'),
    sa.Column('against_vote_num', mysql.INTEGER(), autoincrement=False, nullable=True, comment='反对的投票数量'),
    sa.Column('lottery_limit', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True, comment='是否限制抽奖'),
    sa.Column('lottery_num', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='一次投票活动中用户的抽奖次数限制'),
    sa.Column('lucky_draw_remarks', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=100), nullable=True, comment='抽奖备注'),
    sa.Column('support_vote_num', mysql.INTEGER(), autoincrement=False, nullable=True, comment='支持的投票数量'),
    sa.Column('end_date', sa.DATE(), nullable=False, comment='活动结束日期'),
    sa.Column('start_date', sa.DATE(), nullable=False, comment='活动开始日期'),
    sa.CheckConstraint('(`lottery_limit` in (0,1))', name='vote_activity_manage_chk_2'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB',
    mysql_row_format='DYNAMIC'
    )
    op.create_index('ix_vote_activity_manage_state', 'vote_activity_manage', ['state'], unique=False)
    op.create_index('ix_vote_activity_manage_deleted_by_id', 'vote_activity_manage', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_create_by_id', 'vote_activity_manage', ['create_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_change_by_id', 'vote_activity_manage', ['change_by_id'], unique=False)
    op.create_index('ix_vote_activity_manage_activity_name', 'vote_activity_manage', ['activity_name'], unique=False)
    op.create_index('id', 'vote_activity_manage', ['id'], unique=True)
    op.create_table('vote_activity_player',
    sa.Column('id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='主键ID'),
    sa.Column('state', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'),
    sa.Column('create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
    sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'),
    sa.Column('last_change_time', mysql.DATETIME(), nullable=True, comment='最后修改的时间'),
    sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
    sa.Column('deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
    sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='删除者id'),
    sa.Column('player_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=100), nullable=False, comment='选手姓名'),
    sa.Column('player_img', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=300), nullable=False, comment='选手图片'),
    sa.Column('player_comment', mysql.TEXT(collation='utf8mb4_unicode_ci'), nullable=False, comment='选手介绍'),
    sa.Column('player_speech', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=100), nullable=True, comment='选手感言'),
    sa.Column('activity_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='投票活动ID'),
    sa.Column('support_vote_num', mysql.INTEGER(), autoincrement=False, nullable=True, comment='支持的投票数量'),
    sa.Column('against_vote_num', mysql.INTEGER(), autoincrement=False, nullable=True, comment='反对的投票数量'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('ix_vote_activity_player_state', 'vote_activity_player', ['state'], unique=False)
    op.create_index('ix_vote_activity_player_player_name', 'vote_activity_player', ['player_name'], unique=False)
    op.create_index('ix_vote_activity_player_deleted_by_id', 'vote_activity_player', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_create_by_id', 'vote_activity_player', ['create_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_change_by_id', 'vote_activity_player', ['change_by_id'], unique=False)
    op.create_index('ix_vote_activity_player_activity_id', 'vote_activity_player', ['activity_id'], unique=False)
    op.create_index('id', 'vote_activity_player', ['id'], unique=True)
    op.create_table('vote_subscriber_gift',
    sa.Column('id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='主键ID'),
    sa.Column('state', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'),
    sa.Column('create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
    sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'),
    sa.Column('last_change_time', mysql.DATETIME(), nullable=True, comment='最后修改的时间'),
    sa.Column('deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
    sa.Column('gift_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='奖品ID'),
    sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
    sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='删除者id'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('ix_vote_subscriber_gift_state', 'vote_subscriber_gift', ['state'], unique=False)
    op.create_index('ix_vote_subscriber_gift_gift_id', 'vote_subscriber_gift', ['gift_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_deleted_by_id', 'vote_subscriber_gift', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_create_by_id', 'vote_subscriber_gift', ['create_by_id'], unique=False)
    op.create_index('ix_vote_subscriber_gift_change_by_id', 'vote_subscriber_gift', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_subscriber_gift', ['id'], unique=True)
    op.create_table('vote_player_comment',
    sa.Column('id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='主键ID'),
    sa.Column('state', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'),
    sa.Column('create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
    sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'),
    sa.Column('last_change_time', mysql.DATETIME(), nullable=True, comment='最后修改的时间'),
    sa.Column('deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
    sa.Column('player_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='选手ID'),
    sa.Column('parent_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=True, comment='评论者id自关联'),
    sa.Column('support_or_against', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True, comment='支持还是反对'),
    sa.Column('comment', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=150), nullable=False, comment='评论'),
    sa.Column('support_num', mysql.INTEGER(), autoincrement=False, nullable=True, comment='点赞数'),
    sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
    sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='删除者id'),
    sa.CheckConstraint('(`support_or_against` in (0,1))', name='vote_player_comment_chk_1'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('ix_vote_player_comment_state', 'vote_player_comment', ['state'], unique=False)
    op.create_index('ix_vote_player_comment_player_id', 'vote_player_comment', ['player_id'], unique=False)
    op.create_index('ix_vote_player_comment_deleted_by_id', 'vote_player_comment', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_player_comment_create_by_id', 'vote_player_comment', ['create_by_id'], unique=False)
    op.create_index('ix_vote_player_comment_change_by_id', 'vote_player_comment', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_player_comment', ['id'], unique=True)
    op.create_table('vote_luck_draw_gift',
    sa.Column('id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='主键ID'),
    sa.Column('state', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'),
    sa.Column('create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
    sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'),
    sa.Column('last_change_time', mysql.DATETIME(), nullable=True, comment='最后修改的时间'),
    sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
    sa.Column('deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
    sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='删除者id'),
    sa.Column('activity_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='投票活动ID'),
    sa.Column('gift_name', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=100), nullable=False, comment='奖品名称'),
    sa.Column('gift_img', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=300), nullable=True, comment='奖品相片'),
    sa.Column('winning_chance', mysql.FLOAT(), nullable=False, comment='中奖几率'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('ix_vote_luck_draw_gift_state', 'vote_luck_draw_gift', ['state'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_deleted_by_id', 'vote_luck_draw_gift', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_create_by_id', 'vote_luck_draw_gift', ['create_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_change_by_id', 'vote_luck_draw_gift', ['change_by_id'], unique=False)
    op.create_index('ix_vote_luck_draw_gift_activity_id', 'vote_luck_draw_gift', ['activity_id'], unique=False)
    op.create_index('id', 'vote_luck_draw_gift', ['id'], unique=True)
    op.create_table('vote_comment_support',
    sa.Column('id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='主键ID'),
    sa.Column('state', mysql.SMALLINT(), autoincrement=False, nullable=True, comment='状态值, 0为已删除, 1为正常, 2为锁定'),
    sa.Column('create_time', mysql.DATETIME(), nullable=False, comment='创建时间'),
    sa.Column('create_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='创建者ID'),
    sa.Column('last_change_time', mysql.DATETIME(), nullable=True, comment='最后修改的时间'),
    sa.Column('deleted_time', mysql.DATETIME(), nullable=True, comment='删除时间'),
    sa.Column('comment_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='评论id'),
    sa.Column('subscriber_id', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=20), nullable=False, comment='点赞者id'),
    sa.Column('change_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='最后修改者ID'),
    sa.Column('deleted_by_id', mysql.BIGINT(), autoincrement=False, nullable=True, comment='删除者id'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_unicode_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('ix_vote_comment_support_subscriber_id', 'vote_comment_support', ['subscriber_id'], unique=False)
    op.create_index('ix_vote_comment_support_state', 'vote_comment_support', ['state'], unique=False)
    op.create_index('ix_vote_comment_support_deleted_by_id', 'vote_comment_support', ['deleted_by_id'], unique=False)
    op.create_index('ix_vote_comment_support_create_by_id', 'vote_comment_support', ['create_by_id'], unique=False)
    op.create_index('ix_vote_comment_support_comment_id', 'vote_comment_support', ['comment_id'], unique=False)
    op.create_index('ix_vote_comment_support_change_by_id', 'vote_comment_support', ['change_by_id'], unique=False)
    op.create_index('id', 'vote_comment_support', ['id'], unique=True)
    # ### end Alembic commands ###
