Compare commits

..

4 Commits

Author SHA1 Message Date
4d876ab1c8 Changelog for v1.10.6 (#10699)
* Changelog for v1.10.6

* Add warnning

* Apply suggestions from code review

Co-Authored-By: John Olheiser <john.olheiser@gmail.com>

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2020-03-10 17:09:54 +00:00
f58715d903 cross compile using go 1.13.x (#10684) (#10696)
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-03-10 16:25:59 +01:00
81072af8ce add changelog for v1.10.5 (#10628) 2020-03-06 06:34:28 +00:00
guillep2k
1d7a855d66 Fix migration bug on v96.go (#10572) (#10574)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-03-02 10:32:38 -06:00
3 changed files with 45 additions and 19 deletions

View File

@ -389,7 +389,7 @@ steps:
- name: static
pull: always
image: techknowlogick/xgo:latest
image: techknowlogick/xgo:go-1.13.x
commands:
- export PATH=$PATH:$GOPATH/bin
- make generate
@ -491,7 +491,7 @@ steps:
- name: static
pull: always
image: techknowlogick/xgo:latest
image: techknowlogick/xgo:go-1.13.x
commands:
- export PATH=$PATH:$GOPATH/bin
- make generate

View File

@ -4,6 +4,17 @@ This changelog goes through all the changes that have been made in each release
without substantial changes to our git log; to see the highlights of what has
been added to each release, please refer to the [blog](https://blog.gitea.io).
## [1.10.6](https://github.com/go-gitea/gitea/releases/tag/v1.10.6) - 2020-03-10
This is a re-tag version of v1.10.5 and also explicitly built with Go 1.13.
WARNING: v1.10.5 is incorrectly tagged targeting 1.12-dev and should **not** be used.
## [1.10.5](https://github.com/go-gitea/gitea/releases/tag/v1.10.5) - 2020-03-06
* BUGFIXES
* Fix release attachments being deleted while upgrading (#10572) (#10574)
## [1.10.4](https://github.com/go-gitea/gitea/releases/tag/v1.10.4) - 2020-02-16
* FEATURE

View File

@ -26,23 +26,38 @@ func deleteOrphanedAttachments(x *xorm.Engine) error {
sess := x.NewSession()
defer sess.Close()
err := sess.BufferSize(setting.Database.IterateBufferSize).
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)
if err := os.RemoveAll(models.AttachmentLocalPath(attachment.UUID)); err != nil {
return err
}
_, err := sess.ID(attachment.ID).NoAutoCondition().Delete(attachment)
return err
})
if err != nil {
return err
var limit = setting.Database.IterateBufferSize
if limit <= 0 {
limit = 50
}
return sess.Commit()
for {
attachements := make([]Attachment, 0, limit)
if err := sess.Where("`issue_id` = 0 and (`release_id` = 0 or `release_id` not in (select `id` from `release`))").
Cols("id, uuid").Limit(limit).
Asc("id").
Find(&attachements); err != nil {
return err
}
if len(attachements) == 0 {
return nil
}
var ids = make([]int64, 0, limit)
for _, attachment := range attachements {
ids = append(ids, attachment.ID)
}
if _, err := sess.In("id", ids).Delete(new(Attachment)); err != nil {
return err
}
for _, attachment := range attachements {
if err := os.RemoveAll(models.AttachmentLocalPath(attachment.UUID)); err != nil {
return err
}
}
if len(attachements) < limit {
return nil
}
}
}