From d1f5bced4e7eedcb6a34491c798982ec12c095ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=B6=E7=88=B8?= <1@5.nu> Date: Sun, 10 Jun 2018 19:23:10 +0800 Subject: [PATCH] one SQL per Exec --- models/migrations/v18.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/models/migrations/v18.go b/models/migrations/v18.go index 1185692ac..839e181f3 100644 --- a/models/migrations/v18.go +++ b/models/migrations/v18.go @@ -9,6 +9,10 @@ import ( ) func cleanUnlinkedWebhookAndHookTasks(x *xorm.Engine) error { - _, 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);`) + _, err := x.Exec(`DELETE FROM webhook WHERE repo_id NOT IN (SELECT id FROM repository);`) + if err != nil { + return err + } + _, err = x.Exec(`DELETE FROM hook_task WHERE repo_id NOT IN (SELECT id FROM repository);`) return err }