Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagetext
themeConfluence
delete from role_domain where domain_id = 5

Hopefully, you will see 1 row affected, which means that the query has executed correctly and the reference to the domain has been deleted from this table

...

Unfortunately, that query returns the following error...

...because there is a row in in ldap_group that is referencing the id in a row of the usergroup table we need to delete.  Therefor taht that row in the the ldap_group table needs to be deleted first.

...

Code Block
languagetext
themeConfluence
DELETE tpa FROM tbl_policy_applications tpa
JOIN tbl_policy tp ON tpa.policy_id = tp.id
JOIN usergroup ug ON tp.group_id = ug.id
WHERE ug.domain_id = 5;

If successful, you need to then run the previous query (DELETE tp FROM tbl_policy tp...)  followed by the query before that (delete from usergroup...) until you get back to the first query (delete from domain where name = ...)

You need to follow the pattern above until the first query to delete the domain executes successfully.

You can always copy and paste any errors into AI and ask it to generate a query to resolve the issue.