Skip to content

Draft: Add loose foreign keys

Bishwa Hang Rai requested to merge 444666-loose-foreign-key into master

What does this MR do and why?

Add loose foreign keys

The code diff introduces a loose foreign key on the subscription_user_add_on_assignments table, allowing for orphaned records when the referenced user is deleted. This change is accompanied by the removal of the foreign key constraint on the users table, ensuring data integrity. Additionally, a migration is added to remove the foreign key constraint on the subscription_user_add_on_assignments table, and a test is included to verify the cleanup behavior of the loose foreign key. The diff also updates the documentation to reflect the new loose foreign key.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Related to #444666

Edited by Bishwa Hang Rai

Merge request reports