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 }