You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.5 KiB
Python

"""empty message
Revision ID: 5eb37be53e1c
Revises: fffd191071bc
Create Date: 2025-10-20 13:47:47.890488
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5eb37be53e1c'
down_revision = 'fffd191071bc'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('sys_menu', schema=None) as batch_op:
batch_op.alter_column('component',
existing_type=sa.VARCHAR(length=255),
nullable=True)
batch_op.alter_column('parent_id',
existing_type=sa.VARCHAR(length=36),
nullable=True)
batch_op.create_unique_constraint(batch_op.f('uq_sys_menu_name'), ['name'])
batch_op.create_unique_constraint(batch_op.f('uq_sys_menu_path'), ['path'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('sys_menu', schema=None) as batch_op:
batch_op.drop_constraint(batch_op.f('uq_sys_menu_path'), type_='unique')
batch_op.drop_constraint(batch_op.f('uq_sys_menu_name'), type_='unique')
batch_op.alter_column('parent_id',
existing_type=sa.VARCHAR(length=36),
nullable=False)
batch_op.alter_column('component',
existing_type=sa.VARCHAR(length=255),
nullable=False)
# ### end Alembic commands ###