summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-11-04 13:20:27 +0000
committerLin Jen-Shin <godfat@godfat.org>2017-11-06 19:55:21 +0800
commiteb83965b7f29690c7c772fda6af5759da152593a (patch)
tree4e752e5349a763cc2ad5b0409d66fbbdd5823f82
parent2dd66ad34a5b4a2d50da31ae440470ef02d28aaf (diff)
downloadgitlab-ce-eb83965b7f29690c7c772fda6af5759da152593a.tar.gz
Merge branch 'fix_migration_that_adds_ff_merge_field' into 'master'
Fix a migration that adds merge_requests_ff_only_enabled column to MR table Closes #39382 and #39357 See merge request gitlab-org/gitlab-ce!15195
-rw-r--r--changelogs/unreleased/fix_migration_that_adds_ff_merge_field.yml5
-rw-r--r--db/migrate/20150827121444_add_fast_forward_option_to_project.rb6
2 files changed, 10 insertions, 1 deletions
diff --git a/changelogs/unreleased/fix_migration_that_adds_ff_merge_field.yml b/changelogs/unreleased/fix_migration_that_adds_ff_merge_field.yml
new file mode 100644
index 00000000000..a1685497331
--- /dev/null
+++ b/changelogs/unreleased/fix_migration_that_adds_ff_merge_field.yml
@@ -0,0 +1,5 @@
+---
+title: Fix a migration that adds merge_requests_ff_only_enabled column to MR table
+merge_request:
+author:
+type: fixed
diff --git a/db/migrate/20150827121444_add_fast_forward_option_to_project.rb b/db/migrate/20150827121444_add_fast_forward_option_to_project.rb
index 6f22641077d..35df121519e 100644
--- a/db/migrate/20150827121444_add_fast_forward_option_to_project.rb
+++ b/db/migrate/20150827121444_add_fast_forward_option_to_project.rb
@@ -8,7 +8,11 @@ class AddFastForwardOptionToProject < ActiveRecord::Migration
disable_ddl_transaction!
def up
- add_column_with_default(:projects, :merge_requests_ff_only_enabled, :boolean, default: false)
+ # We put condition here because of a mistake we made a couple of years ago
+ # see https://gitlab.com/gitlab-org/gitlab-ce/issues/39382#note_45716103
+ unless column_exists?(:projects, :merge_requests_ff_only_enabled)
+ add_column_with_default(:projects, :merge_requests_ff_only_enabled, :boolean, default: false)
+ end
end
def down