add migration before 20171207150343

This commit is contained in:
James Lopez 2018-02-03 09:21:41 +01:00
parent a306c1957e
commit b1f4dffda0
No known key found for this signature in database
GPG Key ID: 756BF8E9D7C0CF39
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
# Copy of 20180202111106 - this one should run before 20171207150343 to fix issues related to
# the removal of groups with labels.
class RemoveProjectLabelsGroupIdCopy < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
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
end
def down
end
end