diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-08 21:09:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-08 21:09:16 +0300 |
commit | 80e9fdc9682cfbcfb9202a2733605a6a6bd23f05 (patch) | |
tree | 168375ea13d1a1f01d4cbcf6f0513fc9883e9477 /doc/development/foreign_keys.md | |
parent | 5372e109c0660e4670aa987568a51082beca1b3c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/foreign_keys.md')
-rw-r--r-- | doc/development/foreign_keys.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/development/foreign_keys.md b/doc/development/foreign_keys.md index 38b60ce6f0b..508e5665f08 100644 --- a/doc/development/foreign_keys.md +++ b/doc/development/foreign_keys.md @@ -87,3 +87,13 @@ create_table :user_configs, id: false do |t| ... end ``` + +You will also need to add the new primary key to the model: + +```ruby +class UserConfig < ActiveRecord::Base + self.primary_key = :user_id + + belongs_to :user +end +``` |