Commit b7c5cf9e authored by Yorick Peterse's avatar Yorick Peterse

Don't drop in DropAndReaddHasExternalWikiInProjects

Dropping a column and then re-adding it can lead to the application
throwing errors as the column may temporarily not exist. To work around
this we'll reset the various project rows in batches _without_ removing
any columns.
parent 2d7516ff
...@@ -5,8 +5,9 @@ class DropAndReaddHasExternalWikiInProjects < ActiveRecord::Migration ...@@ -5,8 +5,9 @@ class DropAndReaddHasExternalWikiInProjects < ActiveRecord::Migration
DOWNTIME = false DOWNTIME = false
def up def up
remove_column :projects, :has_external_wiki, :boolean update_column_in_batches(:projects, :has_external_wiki, nil) do |table, query|
add_column :projects, :has_external_wiki, :boolean query.where(table[:has_external_wiki].not_eq(nil))
end
end end
def down def down
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment