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
7695e57b
Commit
7695e57b
authored
May 05, 2021
by
Andy Soiron
Committed by
Amy Qualls
May 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs: Add index name truncation suggestions
parent
05c87a33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
doc/development/migration_style_guide.md
doc/development/migration_style_guide.md
+12
-0
No files found.
doc/development/migration_style_guide.md
View file @
7695e57b
...
...
@@ -126,6 +126,18 @@ Examples:
-
`index_projects_on_id_service_desk_enabled`
-
`index_clusters_on_enabled_cluster_type_id_and_created_at`
### Truncate long index names
PostgreSQL
[
limits the length of identifiers
](
https://www.postgresql.org/docs/current/limits.html
)
,
like column or index names. Column names are not usually a problem, but index names tend
to be longer. Some methods for shortening a name that's too long:
-
Prefix it with
`i_`
instead of
`index_`
.
-
Skip redundant prefixes. For example,
`index_vulnerability_findings_remediations_on_vulnerability_remediation_id`
becomes
`index_vulnerability_findings_remediations_on_remediation_id`
.
-
Instead of columns, specify the purpose of the index, such as
`index_users_for_unconfirmation_notification`
.
## Heavy operations in a single transaction
When using a single-transaction migration, a transaction holds a database connection
...
...
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