提交 9611a410 编写于 作者: S Stan Hu

Fix missing WHERE clause in 20171106135924_issues_milestone_id_foreign_key migration

If milestone_id is NULL, we shouldn't need to update it to be NULL again. This
was causing us to touch almost all rows in the issues table for no good
reason.

Closes https://gitlab.com/gitlab-com/infrastructure/issues/3416
上级 f7a9ced2
......@@ -16,6 +16,7 @@ class IssuesMilestoneIdForeignKey < ActiveRecord::Migration
def self.with_orphaned_milestones
where('NOT EXISTS (SELECT true FROM milestones WHERE milestones.id = issues.milestone_id)')
.where('milestone_id IS NOT NULL')
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册