Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7fad964a
Commit
7fad964a
authored
Feb 24, 2021
by
Tiger Watson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify using `add_reference` with high-traffic tables
parent
4293e42d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
doc/development/migration_style_guide.md
doc/development/migration_style_guide.md
+4
-3
No files found.
doc/development/migration_style_guide.md
View file @
7fad964a
...
...
@@ -605,9 +605,10 @@ When adding a foreign-key constraint to an existing column in a non-empty table,
we have to employ
`add_concurrent_foreign_key`
and
`add_concurrent_index`
instead of
`add_reference`
.
For an empty table (such as a fresh one), it is recommended to use
`add_reference`
in a single-transaction migration, combining it with other
operations that don't require
`disable_ddl_transaction!`
.
If you have a new or empty table that doesn't reference a
[
high-traffic table
](
https://gitlab.com/gitlab-org/gitlab/-/blob/master/rubocop/rubocop-migrations.yml#L3
)
,
we recommend that you use
`add_reference`
in a single-transaction migration. You can
combine it with other operations that don't require
`disable_ddl_transaction!`
.
You can read more about adding
[
foreign key constraints to an existing column
](
database/add_foreign_key_to_existing_column.md
)
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment