47 lines
2.5 KiB
Python
47 lines
2.5 KiB
Python
"""update
|
||
|
||
Revision ID: 2d8939b3a228
|
||
Revises: ecb50546debd
|
||
Create Date: 2022-09-22 16:34:00.663906
|
||
|
||
"""
|
||
from alembic import op
|
||
import sqlalchemy as sa
|
||
from sqlalchemy.dialects import mysql
|
||
|
||
# revision identifiers, used by Alembic.
|
||
revision = '2d8939b3a228'
|
||
down_revision = 'ecb50546debd'
|
||
branch_labels = None
|
||
depends_on = None
|
||
|
||
|
||
def upgrade():
|
||
# ### commands auto generated by Alembic - please adjust! ###
|
||
op.add_column('vadmin_auth_menu', sa.Column('name', sa.String(length=50), nullable=False, comment='名称'))
|
||
op.add_column('vadmin_auth_menu', sa.Column('noCache', sa.Boolean(), nullable=True, comment='如果设置为true,则不会被 <keep-alive> 缓存(默认 false)'))
|
||
op.add_column('vadmin_auth_menu', sa.Column('breadcrumb', sa.Boolean(), nullable=True, comment='如果设置为false,则不会在breadcrumb面包屑中显示(默认 true)'))
|
||
op.add_column('vadmin_auth_menu', sa.Column('affix', sa.Boolean(), nullable=True, comment='如果设置为true,则会一直固定在tag项中(默认 false)'))
|
||
op.add_column('vadmin_auth_menu', sa.Column('noTagsView', sa.Boolean(), nullable=True, comment='如果设置为true,则不会出现在tag中(默认 false)'))
|
||
op.add_column('vadmin_auth_menu', sa.Column('canTo', sa.Boolean(), nullable=True, comment='设置为true即使hidden为true,也依然可以进行路由跳转(默认 false)'))
|
||
op.drop_index('ix_vadmin_auth_menu_title', table_name='vadmin_auth_menu')
|
||
op.create_index(op.f('ix_vadmin_auth_menu_name'), 'vadmin_auth_menu', ['name'], unique=False)
|
||
op.drop_column('vadmin_auth_menu', 'title_zh')
|
||
op.drop_column('vadmin_auth_menu', 'title')
|
||
# ### end Alembic commands ###
|
||
|
||
|
||
def downgrade():
|
||
# ### commands auto generated by Alembic - please adjust! ###
|
||
op.add_column('vadmin_auth_menu', sa.Column('title', mysql.VARCHAR(length=50), nullable=False, comment='名称'))
|
||
op.add_column('vadmin_auth_menu', sa.Column('title_zh', mysql.VARCHAR(length=50), nullable=True, comment='中文名称'))
|
||
op.drop_index(op.f('ix_vadmin_auth_menu_name'), table_name='vadmin_auth_menu')
|
||
op.create_index('ix_vadmin_auth_menu_title', 'vadmin_auth_menu', ['title'], unique=False)
|
||
op.drop_column('vadmin_auth_menu', 'canTo')
|
||
op.drop_column('vadmin_auth_menu', 'noTagsView')
|
||
op.drop_column('vadmin_auth_menu', 'affix')
|
||
op.drop_column('vadmin_auth_menu', 'breadcrumb')
|
||
op.drop_column('vadmin_auth_menu', 'noCache')
|
||
op.drop_column('vadmin_auth_menu', 'name')
|
||
# ### end Alembic commands ###
|