From dd611c9a86f5a192a7a76146613a7e087b09f221 Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Wed, 9 Oct 2019 06:36:53 -0300 Subject: [PATCH] Fix migration v96 to keep issue attachments (#8435) * Fix migration v96 to keep issue attachments * Fix == operator --- models/migrations/v96.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/migrations/v96.go b/models/migrations/v96.go index 5c2135ffc..34f67534c 100644 --- a/models/migrations/v96.go +++ b/models/migrations/v96.go @@ -27,7 +27,7 @@ func deleteOrphanedAttachments(x *xorm.Engine) error { defer sess.Close() err := sess.BufferSize(setting.Database.IterateBufferSize). - Where("`comment_id` = 0 and (`release_id` = 0 or `release_id` not in (select `id` from `release`))").Cols("uuid"). + Where("`issue_id` = 0 and (`release_id` = 0 or `release_id` not in (select `id` from `release`))").Cols("uuid"). Iterate(new(Attachment), func(idx int, bean interface{}) error { attachment := bean.(*Attachment)