mirror of
https://github.com/go-gitea/gitea
synced 2024-12-21 15:57:53 +01:00
Merge master into indexbyfileext
This commit is contained in:
commit
021014acfe
@ -238,6 +238,8 @@ var migrations = []Migration{
|
||||
NewMigration("change length of some repository columns", changeSomeColumnsLengthOfRepo),
|
||||
// v91 -> v92
|
||||
NewMigration("add index on owner_id of repository and type, review_id of comment", addIndexOnRepositoryAndComment),
|
||||
// v92 -> v93
|
||||
NewMigration("remove orphaned repository index statuses", removeLingeringIndexStatus),
|
||||
}
|
||||
|
||||
// Migrate database to current version
|
||||
|
16
models/migrations/v92.go
Normal file
16
models/migrations/v92.go
Normal file
@ -0,0 +1,16 @@
|
||||
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/go-xorm/xorm"
|
||||
"xorm.io/builder"
|
||||
)
|
||||
|
||||
func removeLingeringIndexStatus(x *xorm.Engine) error {
|
||||
|
||||
_, err := x.Exec(builder.Delete(builder.NotIn("`repo_id`", builder.Select("`id`").From("`repository`"))).From("`repo_indexer_status`"))
|
||||
return err
|
||||
}
|
@ -685,12 +685,14 @@ func rewriteAllPublicKeys(e Engine) error {
|
||||
}
|
||||
_, err = t.WriteString(line + "\n")
|
||||
if err != nil {
|
||||
f.Close()
|
||||
return err
|
||||
}
|
||||
}
|
||||
defer f.Close()
|
||||
f.Close()
|
||||
}
|
||||
|
||||
t.Close()
|
||||
return os.Rename(tmpPath, fPath)
|
||||
}
|
||||
|
||||
|
@ -120,8 +120,8 @@ func getSlackDeletePayload(p *api.DeletePayload, slack *SlackMeta) (*SlackPayloa
|
||||
|
||||
// getSlackForkPayload composes Slack payload for forked by a repository.
|
||||
func getSlackForkPayload(p *api.ForkPayload, slack *SlackMeta) (*SlackPayload, error) {
|
||||
baseLink := SlackLinkFormatter(p.Repo.HTMLURL, p.Repo.Name)
|
||||
forkLink := SlackLinkFormatter(p.Forkee.HTMLURL, p.Forkee.FullName)
|
||||
baseLink := SlackLinkFormatter(p.Forkee.HTMLURL, p.Forkee.FullName)
|
||||
forkLink := SlackLinkFormatter(p.Repo.HTMLURL, p.Repo.FullName)
|
||||
text := fmt.Sprintf("%s is forked to %s", baseLink, forkLink)
|
||||
return &SlackPayload{
|
||||
Channel: slack.Channel,
|
||||
|
Loading…
Reference in New Issue
Block a user