Fix migration v96 to keep issue attachments (#8435)

* Fix migration v96 to keep issue attachments

* Fix == operator
tokarchuk/v1.17
guillep2k 5 years ago committed by Lunny Xiao
parent 3810fa48ac
commit dd611c9a86
  1. 2
      models/migrations/v96.go

@ -27,7 +27,7 @@ func deleteOrphanedAttachments(x *xorm.Engine) error {
defer sess.Close() defer sess.Close()
err := sess.BufferSize(setting.Database.IterateBufferSize). 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), Iterate(new(Attachment),
func(idx int, bean interface{}) error { func(idx int, bean interface{}) error {
attachment := bean.(*Attachment) attachment := bean.(*Attachment)

Loading…
Cancel
Save