From a30becfaf5d559a4ae2c34d577b91ba6dc798b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=B6=E7=88=B8?= <1@5.nu> Date: Fri, 8 Jun 2018 09:19:44 +0800 Subject: [PATCH] available for MongoDB --- models/migrations/v67.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/models/migrations/v67.go b/models/migrations/v67.go index 496a254e0..94b68cae7 100644 --- a/models/migrations/v67.go +++ b/models/migrations/v67.go @@ -1,6 +1,7 @@ -// Copyright 2017 The Gitea Authors. All rights reserved. +// Copyright 2018 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. + package migrations import ( @@ -8,6 +9,6 @@ import ( ) func cleanUnlinkedWebhookAndHookTasks(x *xorm.Engine) error { - _, err := x.Exec(`DELETE FROM webhook WHERE (SELECT id FROM repository WHERE id = webhook.repo_id) ISNULL;DELETE FROM hook_task WHERE (SELECT id FROM repository WHERE id = hook_task.repo_id) ISNULL;`) + _, err := x.Exec(`DELETE FROM webhook WHERE repo_id NOT IN (SELECT id FROM repository);DELETE FROM hook_task WHERE repo_id NOT IN (SELECT id FROM repository);`) return err }