def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('Comment_File_id_fkey', 'Comment', type_='foreignkey')
op.drop_constraint('Comment_User_id_fkey', 'Comment', type_='foreignkey')
op.create_foreign_key('Comment_User_id_fkey', 'Comment', 'User', ['User_id'], ['id'], ondelete='CASCADE')
op.create_foreign_key('Comment_File_id_fkey', 'Comment', 'File', ['File_id'], ['id'], ondelete='CASCADE')
op.drop_index('ix_LinterComment_File_id', table_name='LinterComment')
op.drop_constraint('LinterComment_File_id_fkey', 'LinterComment', type_='foreignkey')
op.create_index(op.f('ix_LinterComment_File_id'), 'LinterComment', ['File_id'], unique=False)
op.create_foreign_key('LinterComment_File_id_fkey', 'LinterComment', 'File', ['File_id'], ['id'], ondelete='CASCADE')
op.drop_constraint('LinterInstance_Work_id_fkey', 'LinterInstance', type_='foreignkey')
op.create_foreign_key('LinterInstance_Work_id_fkey', 'LinterInstance', 'Work', ['Work_id'], ['id'], ondelete='CASCADE')
# ### end Alembic commands ###
评论列表
文章目录