Browse Source

available for postgresql

pull/5277/head
奶爸 7 years ago committed by GitHub
parent
commit
ea90e18926
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      models/migrations/v18.go

4
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 // Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
@ -9,6 +9,6 @@ import (
) )
func cleanUnlinkedWebhookAndHookTasks(x *xorm.Engine) error { 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 return err
} }

Loading…
Cancel
Save