Merge branch 'fix-migration-timestamp' into 'master'

Update labels migration timestamp to run earlier than the one that removes namespaces to avoid issues

See merge request gitlab-org/gitlab-ce!16907
This commit is contained in:
Stan Hu 2018-02-03 13:30:43 +00:00
commit 91d2f92b1a
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
# 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
# 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