BigW Consortium Gitlab

20170309171644_reset_relative_position_for_issue.rb 400 Bytes
Newer Older
1
# rubocop:disable Migration/UpdateColumnInBatches
2 3 4 5 6
class ResetRelativePositionForIssue < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

7 8
  disable_ddl_transaction!

9
  def up
10 11 12
    update_column_in_batches(:issues, :relative_position, nil) do |table, query|
      query.where(table[:relative_position].not_eq(nil))
    end
13 14 15
  end

  def down
16
    # noop
17 18
  end
end