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:
authorRémy Coutable <remy@rymai.me>2016-07-21 13:45:03 +0300
committerRémy Coutable <remy@rymai.me>2016-07-21 13:45:03 +0300
commit3845f12de880c450d317dfb924b79d47791340f1 (patch)
treedbe04b27682148295fc276d20bdd105c746da41a /db/migrate
parent479814b29289ab5598117ff22b63e386a3d2d9f3 (diff)
Fix migration to make it fast
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'db/migrate')
-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