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.
iTi-Flask/migrations/versions/83b464bfff02_.py

51 lines
1.7 KiB
Python

"""empty message
Revision ID: 83b464bfff02
Revises: 3a1d8599c640
Create Date: 2025-10-27 20:02:41.075217
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '83b464bfff02'
down_revision = '3a1d8599c640'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('sys_log', schema=None) as batch_op:
batch_op.alter_column('type',
existing_type=sa.VARCHAR(length=64),
type_=sa.Enum('SYSTEM', 'AUTH', 'OPERATION', 'AUDIT', 'SECURITY', 'JOB', 'API', 'DB', 'PAYMENT', 'MESSAGE', 'OSS', 'OTHER', name='logtype'),
nullable=False)
batch_op.drop_index(batch_op.f('ix_sys_log_type'))
with op.batch_alter_table('sys_user', schema=None) as batch_op:
batch_op.alter_column('realname',
existing_type=sa.VARCHAR(length=32),
nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('sys_user', schema=None) as batch_op:
batch_op.alter_column('realname',
existing_type=sa.VARCHAR(length=32),
nullable=False)
with op.batch_alter_table('sys_log', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_sys_log_type'), ['type'], unique=False)
batch_op.alter_column('type',
existing_type=sa.Enum('SYSTEM', 'AUTH', 'OPERATION', 'AUDIT', 'SECURITY', 'JOB', 'API', 'DB', 'PAYMENT', 'MESSAGE', 'OSS', 'OTHER', name='logtype'),
type_=sa.VARCHAR(length=64),
nullable=True)
# ### end Alembic commands ###