Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-03 12:10:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-03 12:10:02 +0300
commit119f0431e47b76f401dbb92d5774bf3380774038 (patch)
treec6b02ec8b1f3bd2f67add79de2f1cb589c65d85d /doc/development/migration_style_guide.md
parentd3a97bfbd26fe2876f64fa88d0936dfed2246fa1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/migration_style_guide.md')
-rw-r--r--doc/development/migration_style_guide.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/development/migration_style_guide.md b/doc/development/migration_style_guide.md
index 491f65bd88a..9aefbed4f07 100644
--- a/doc/development/migration_style_guide.md
+++ b/doc/development/migration_style_guide.md
@@ -114,6 +114,18 @@ rails schema statement: [`add_index`](https://api.rubyonrails.org/v5.2/classes/A
This is a blocking operation, but it doesn't cause problems because the table is not yet used,
and therefore it does not have any records yet.
+## Naming conventions
+
+We keep column names consistent with [ActiveRecord's schema conventions](https://guides.rubyonrails.org/active_record_basics.html#schema-conventions).
+
+Custom index names should follow the pattern `index_#{table_name}_on_#{column_1}_and_#{column_2}_#{condition}`.
+
+Examples:
+
+- `index_services_on_type_and_id_and_template_when_active`
+- `index_projects_on_id_service_desk_enabled`
+- `index_clusters_on_enabled_cluster_type_id_and_created_at`
+
## Heavy operations in a single transaction
When using a single-transaction migration, a transaction holds a database connection