Fix migration to make it fast

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2016-07-21 12:45:03 +02:00
parent 479814b292
commit 3845f12de8
No known key found for this signature in database
GPG Key ID: 46DF07E5CD9E96AB
2 changed files with 14 additions and 13 deletions

View File

@ -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

View File

@ -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