diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-08 00:17:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-08 00:17:37 +0300 |
commit | f0b862a98200720a23fe3ed2807f4bb911f30d6d (patch) | |
tree | 0a974ff74e5871aad64bae55f0e1fb9c77129f67 /doc/development/database | |
parent | 8bac8f55ba93bb03f7391b939dc6644e67fe5216 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/database')
-rw-r--r-- | doc/development/database/loose_foreign_keys.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/development/database/loose_foreign_keys.md b/doc/development/database/loose_foreign_keys.md index 4cd5fdfa883..ec2c4122081 100644 --- a/doc/development/database/loose_foreign_keys.md +++ b/doc/development/database/loose_foreign_keys.md @@ -161,6 +161,17 @@ it_behaves_like 'it has loose foreign keys' do end ``` +**After** [removing a foreign key](#remove-the-foreign-key), +use the "`cleanup by a loose foreign key`" shared example to test a child record's deletion or nullification +via the added loose foreign key: + +```ruby +it_behaves_like 'cleanup by a loose foreign key' do + let!(:model) { create(:ci_pipeline, user: create(:user)) } + let!(:parent) { model.user } +end +``` + ## Caveats of loose foreign keys ### Record creation |