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.
39 lines
1.4 KiB
Python
39 lines
1.4 KiB
Python
"""empty message
|
|
|
|
Revision ID: f02e03313631
|
|
Revises: 5409f28814f9
|
|
Create Date: 2025-10-30 22:36:59.048268
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = 'f02e03313631'
|
|
down_revision = '5409f28814f9'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('sys_file', schema=None) as batch_op:
|
|
batch_op.drop_constraint(batch_op.f('fk_sys_file_directory_id_sys_file_directory'), type_='foreignkey')
|
|
|
|
with op.batch_alter_table('sys_file_directory', schema=None) as batch_op:
|
|
batch_op.drop_constraint(batch_op.f('fk_sys_file_directory_parent_id_sys_file_directory'), type_='foreignkey')
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table('sys_file_directory', schema=None) as batch_op:
|
|
batch_op.create_foreign_key(batch_op.f('fk_sys_file_directory_parent_id_sys_file_directory'), 'sys_file_directory', ['parent_id'], ['id'], ondelete='CASCADE')
|
|
|
|
with op.batch_alter_table('sys_file', schema=None) as batch_op:
|
|
batch_op.create_foreign_key(batch_op.f('fk_sys_file_directory_id_sys_file_directory'), 'sys_file_directory', ['directory_id'], ['id'], ondelete='SET NULL')
|
|
|
|
# ### end Alembic commands ###
|