<reponame>liliangbin/ft_ssr<filename>migrations/versions/5d1e291bf6cd_gsdfgs.py
"""gsdfgs

Revision ID: <KEY>
Revises: <KEY>
Create Date: 2021-04-16 20:43:17.948386

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

# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('ft_user',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('user_name', sa.String(length=64), nullable=True, comment='用户名，没啥用'),
    sa.Column('wx_name', sa.String(length=256), nullable=True),
    sa.Column('create_at', sa.DateTime(), nullable=True),
    sa.Column('update_at', sa.DateTime(), nullable=True),
    sa.Column('key', sa.String(length=256), nullable=True, comment='用户请求唯一key，路由上用'),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id'),
    sa.UniqueConstraint('key'),
    sa.UniqueConstraint('wx_name')
    )
    op.drop_index('id', table_name='user')
    op.drop_index('key', table_name='user')
    op.drop_index('wx_name', table_name='user')
    op.drop_table('user')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('user',
    sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
    sa.Column('user_name', mysql.VARCHAR(length=64), nullable=True, comment='用户名，没啥用'),
    sa.Column('wx_name', mysql.VARCHAR(length=256), nullable=True),
    sa.Column('create_at', mysql.DATETIME(), nullable=True),
    sa.Column('update_at', mysql.DATETIME(), nullable=True),
    sa.Column('key', mysql.VARCHAR(length=256), nullable=True, comment='用户请求唯一key，路由上用'),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('wx_name', 'user', ['wx_name'], unique=True)
    op.create_index('key', 'user', ['key'], unique=True)
    op.create_index('id', 'user', ['id'], unique=True)
    op.drop_table('ft_user')
    # ### end Alembic commands ###

"""gsdfgs

Revision ID: <KEY>
Revises: <KEY>
Create Date: 2021-04-16 20:43:17.948386

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

# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('ft_user',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('user_name', sa.String(length=64), nullable=True, comment='用户名，没啥用'),
    sa.Column('wx_name', sa.String(length=256), nullable=True),
    sa.Column('create_at', sa.DateTime(), nullable=True),
    sa.Column('update_at', sa.DateTime(), nullable=True),
    sa.Column('key', sa.String(length=256), nullable=True, comment='用户请求唯一key，路由上用'),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id'),
    sa.UniqueConstraint('key'),
    sa.UniqueConstraint('wx_name')
    )
    op.drop_index('id', table_name='user')
    op.drop_index('key', table_name='user')
    op.drop_index('wx_name', table_name='user')
    op.drop_table('user')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('user',
    sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
    sa.Column('user_name', mysql.VARCHAR(length=64), nullable=True, comment='用户名，没啥用'),
    sa.Column('wx_name', mysql.VARCHAR(length=256), nullable=True),
    sa.Column('create_at', mysql.DATETIME(), nullable=True),
    sa.Column('update_at', mysql.DATETIME(), nullable=True),
    sa.Column('key', mysql.VARCHAR(length=256), nullable=True, comment='用户请求唯一key，路由上用'),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('wx_name', 'user', ['wx_name'], unique=True)
    op.create_index('key', 'user', ['key'], unique=True)
    op.create_index('id', 'user', ['id'], unique=True)
    op.drop_table('ft_user')
    # ### end Alembic commands ###
gsdfgs  Revision ID: <KEY> Revises: <KEY> Create Date: 2021-04-16 20:43:17.948386 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###