diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /doc/development/foreign_keys.md | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'doc/development/foreign_keys.md')
-rw-r--r-- | doc/development/foreign_keys.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/development/foreign_keys.md b/doc/development/foreign_keys.md index abe191ace5e..a9edbc68a2e 100644 --- a/doc/development/foreign_keys.md +++ b/doc/development/foreign_keys.md @@ -17,7 +17,7 @@ end Here you will need to add a foreign key on column `posts.user_id`. This ensures that data consistency is enforced on database level. Foreign keys also mean that -the database can very quickly remove associated data (e.g. when removing a +the database can very quickly remove associated data (for example, when removing a user), instead of Rails having to do this. ## Adding Foreign Keys In Migrations @@ -28,7 +28,8 @@ Guide](migration_style_guide.md) for more information. Keep in mind that you can only safely add foreign keys to existing tables after you have removed any orphaned rows. The method `add_concurrent_foreign_key` -does not take care of this so you'll need to do so manually. +does not take care of this so you'll need to do so manually. See +[adding foreign key constraint to an existing column](database/add_foreign_key_to_existing_column.md). ## Cascading Deletes |