Skip to content

Entitlements SQL database review and fix data integrity flaws (GONRG-5831)

Riabokon Stanislav(EPAM)[GCP] requested to merge gc-group-cascade into master

Issue: We have general issues with Ent SQL workflow, integrity not being respected in flows related to data modification:

https://community.opengroup.org/osdu/platform/security-and-compliance/entitlements/-/blob/master/provider/entitlements-v2-jdbc/src/main/java/org/opengroup/osdu/entitlements/v2/jdbc/spi/jdbc/deletegroup/DeleteGroupRepoJdbc.java#L64

Pack of queries to delete the group and its relations not wrapped in a single transaction. Such integrity could be provided at the Data Definition step, but it's not, there are no rules for cascade deletion:

https://community.opengroup.org/osdu/platform/security-and-compliance/entitlements/-/blob/master/provider/entitlements-v2-jdbc/cloudbuild/create-db-script.sql#L68

Solution: Added 'ON DELETE CASCADE' to remove groups.

Edited by Riabokon Stanislav(EPAM)[GCP]

Merge request reports

Loading