Add member namespace id db constraints
What does this MR do and why?
Describe in detail what your merge request does and why.
- add NOT NULL constraint for
member_namespace_id
column - change
add_concurrent_foreign_key :members, :namespaces, column: :namespace_id, on_delete: :nullify
toadd_concurrent_foreign_key :members, :namespaces, column: :namespace_id, on_delete: :cascade
- Migration file 1: Re-add the check constraint (not valid)
- Migration file 2: Validate the check constraint
- Migration file 3: Validate the new FK (
fk_2f85abf8f1
) - Migration file 4: Drop the old FK with the
SET NULL
clause (fk_aa82dcc1c6
)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Serena Fang