2018-03-17 18:26:18 +05:30
|
|
|
# rubocop:disable Migration/UpdateLargeTable
|
2017-09-10 17:25:29 +05:30
|
|
|
# rubocop:disable Migration/UpdateColumnInBatches
|
2019-01-03 12:48:30 +05:30
|
|
|
class ResetRelativePositionForIssue < ActiveRecord::Migration
|
2017-08-17 22:00:37 +05:30
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
disable_ddl_transaction!
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def up
|
|
|
|
update_column_in_batches(:issues, :relative_position, nil) do |table, query|
|
|
|
|
query.where(table[:relative_position].not_eq(nil))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
2017-09-10 17:25:29 +05:30
|
|
|
# noop
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|