summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axilleas@axilleas.me>2016-08-10 14:15:16 +0000
committerAchilleas Pipinellis <axilleas@axilleas.me>2016-08-10 14:15:16 +0000
commitae2d3c417075c83e169ab7662f3dd11e3b2bf043 (patch)
treeacd0a5bb1af3323e72d55916ac09a3b63dcee602
parentb50e8c293452f65990f1a97050b474c95755b660 (diff)
parentee451ea5739c5d574a5c3c7db36c5a4c28206fd5 (diff)
downloadgitlab-ce-ae2d3c417075c83e169ab7662f3dd11e3b2bf043.tar.gz
Merge branch 'add-column-with-default-to-downtime-guide' into 'master'
Mention add_column_with_default in downtime guide ## What does this MR do? This extends the "What causes downtime" guide with a mention of the `add_column_with_default` migration helper. ## Are there points in the code the reviewer needs to double check? Spelling, grammar, etc. ## Why was this MR needed? Currently the guide may lead one to believe it's not possible at all to add a column with a default value. ## Does this MR meet the acceptance criteria? - [x] ~~[CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added~~ - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - Tests - [ ] All builds are passing - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5719
-rw-r--r--doc/development/what_requires_downtime.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/development/what_requires_downtime.md b/doc/development/what_requires_downtime.md
index abd693cf72d..2574c2c0472 100644
--- a/doc/development/what_requires_downtime.md
+++ b/doc/development/what_requires_downtime.md
@@ -31,6 +31,14 @@ operation, even when using `ALGORITHM=INPLACE` and `LOCK=NONE`. This means
downtime _may_ be required when modifying large tables as otherwise the
operation could potentially take hours to complete.
+Adding a column with a default value _can_ be done without requiring downtime
+when using the migration helper method
+`Gitlab::Database::MigrationHelpers#add_column_with_default`. This method works
+similar to `add_column` except it updates existing rows in batches without
+blocking access to the table being modified. See ["Adding Columns With Default
+Values"](migration_style_guide.html#adding-columns-with-default-values) for more
+information on how to use this method.
+
## Dropping Columns
On PostgreSQL you can safely remove an existing column without the need for