From ea90e18926a7fe979c0278fc9710b27d8f1896f6 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:25:07 +0800 Subject: [PATCH] available for postgresql --- models/migrations/v18.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/migrations/v18.go b/models/migrations/v18.go index a7c49677e..1185692ac 100644 --- a/models/migrations/v18.go +++ b/models/migrations/v18.go @@ -1,4 +1,4 @@ -// Copyright 2017 The Gogs Authors. All rights reserved. +// Copyright 2018 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. @@ -9,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 }