Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20160721081015_drop_and_readd_has_external_wiki_in_projects.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 58f7f2a284171534eef1512e318e8ac6f9e52190 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# rubocop:disable Migration/UpdateLargeTable
# rubocop:disable Migration/UpdateColumnInBatches
class DropAndReaddHasExternalWikiInProjects < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  # Set this constant to true if this migration requires downtime.
  DOWNTIME = false

  disable_ddl_transaction!

  def up
    update_column_in_batches(:projects, :has_external_wiki, nil) do |table, query|
      query.where(table[:has_external_wiki].not_eq(nil))
    end
  end

  def down
  end
end