Query To Delete Folder and Dependencies

I want to delete everything associate with this project.

The entities within the project are dependent upon one another in some fashion so attempting to delete something gives me the following error.

Is there a way I can just delete everything in my project using a query?

Comments

  • The following queries will pull in all designer elements (Flows, Rules, etc.) These queries function by setting objects within a Decisions Project to 'deleted', just as a standard deletion would. We'll need to make sure that only items we intend to delete are included in the project.

    This query only performs a SELECT, and makes no changes to the database. I would recommend running this prior to the UPDATE query, just to ensure we're pulling the right objects.

    SELECT * FROM element_registration
    WHERE entity_folder_id IN (SELECT entity_id FROM module_resource WHERE module_name ='ProjectNameHere')
    

    This query will take all items associated with the project, and set the deleted field to true.

    UPDATE element_registration
    SET deleted = 'true'
    WHERE entity_folder_id IN (SELECT entity_id FROM module_resource WHERE module_name ='ProjectNameHere')
    

    Once we run that second query, restart the instance.

    It is always best practice to take a database backup prior to running any queries.

Sign In or Register to comment.