summaryrefslogtreecommitdiff
path: root/db/post_migrate/20170927112318_update_legacy_diff_notes_type_for_import.rb
blob: b040c81b316477d5d033a39296bbc21703af95f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# rubocop:disable Migration/UpdateLargeTable
class UpdateLegacyDiffNotesTypeForImport < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    update_column_in_batches(:notes, :type, 'LegacyDiffNote') do |table, query|
      query.where(table[:type].eq('Github::Import::LegacyDiffNote'))
    end
  end

  def down
  end
end