summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-07-21 11:36:06 +0000
committerStan Hu <stanhu@gmail.com>2016-07-21 11:36:06 +0000
commit4e40ba93dcfc339ab4baa47ef39e1a570e4fc902 (patch)
treecc2ef1a7d680f2953304b4da996b2f55a3a3dc7c
parent71b8ca038b38a12fdc1dc7463b57a67fb8b7fcb2 (diff)
parent3845f12de880c450d317dfb924b79d47791340f1 (diff)
downloadgitlab-ce-4e40ba93dcfc339ab4baa47ef39e1a570e4fc902.tar.gz
Merge branch 'fix-migration-introduced-by-5387' into 'master'
Fix migration to make it fast ## What does this MR do? Changing the migration introduced in !5387 so that it's fast. The idea is that the content of the `projects.has_external_wiki` is currently wrong, so we can just drop and recreate the column. ## Does this MR meet the acceptance criteria? - [x] No CHANGELOG needed - Tests - [ ] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] 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 !5394
-rw-r--r--db/migrate/20160721081015_drop_and_readd_has_external_wiki_in_projects.rb14
-rw-r--r--db/migrate/20160721081015_nullify_has_external_wiki_in_projects.rb13
2 files changed, 14 insertions, 13 deletions
diff --git a/db/migrate/20160721081015_drop_and_readd_has_external_wiki_in_projects.rb b/db/migrate/20160721081015_drop_and_readd_has_external_wiki_in_projects.rb
new file mode 100644
index 00000000000..459a120155d
--- /dev/null
+++ b/db/migrate/20160721081015_drop_and_readd_has_external_wiki_in_projects.rb
@@ -0,0 +1,14 @@
+class DropAndReaddHasExternalWikiInProjects < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def up
+ remove_column :projects, :has_external_wiki, :boolean
+ add_column :projects, :has_external_wiki, :boolean
+ end
+
+ def down
+ end
+end
diff --git a/db/migrate/20160721081015_nullify_has_external_wiki_in_projects.rb b/db/migrate/20160721081015_nullify_has_external_wiki_in_projects.rb
deleted file mode 100644
index 4bb5bb79632..00000000000
--- a/db/migrate/20160721081015_nullify_has_external_wiki_in_projects.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-class NullifyHasExternalWikiInProjects < ActiveRecord::Migration
- include Gitlab::Database::MigrationHelpers
-
- # Set this constant to true if this migration requires downtime.
- DOWNTIME = false
-
- def up
- execute("UPDATE projects SET has_external_wiki = NULL")
- end
-
- def down
- end
-end