2018-03-17 18:26:18 +05:30
|
|
|
# Copy of 20180202111106 - this one should run before 20171207150343 to fix issues related to
|
|
|
|
# the removal of groups with labels.
|
|
|
|
|
2018-12-23 12:14:25 +05:30
|
|
|
class RemoveProjectLabelsGroupIdCopy < ActiveRecord::Migration[4.2]
|
2018-03-17 18:26:18 +05:30
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
|
|
|
# rubocop:disable Migration/UpdateColumnInBatches
|
|
|
|
update_column_in_batches(:labels, :group_id, nil) do |table, query|
|
|
|
|
query.where(table[:type].eq('ProjectLabel').and(table[:group_id].not_eq(nil)))
|
|
|
|
end
|
|
|
|
# rubocop:enable Migration/UpdateColumnInBatches
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
end
|
|
|
|
end
|