mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
Retry create issue to cope with duplicate keys (#7898)
* Retry create issue to cope with duplicate keys * Use .SetExpr().Where().Insert()
This commit is contained in:
committed by
techknowlogick
parent
541fab196f
commit
5fe2ec264f
7
vendor/xorm.io/core/index.go
generated
vendored
7
vendor/xorm.io/core/index.go
generated
vendored
@@ -9,12 +9,13 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// enumerate all index types
|
||||
const (
|
||||
IndexType = iota + 1
|
||||
UniqueType
|
||||
)
|
||||
|
||||
// database index
|
||||
// Index represents a database index
|
||||
type Index struct {
|
||||
IsRegular bool
|
||||
Name string
|
||||
@@ -35,7 +36,7 @@ func (index *Index) XName(tableName string) string {
|
||||
return index.Name
|
||||
}
|
||||
|
||||
// add columns which will be composite index
|
||||
// AddColumn add columns which will be composite index
|
||||
func (index *Index) AddColumn(cols ...string) {
|
||||
for _, col := range cols {
|
||||
index.Cols = append(index.Cols, col)
|
||||
@@ -65,7 +66,7 @@ func (index *Index) Equal(dst *Index) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// new an index
|
||||
// NewIndex new an index object
|
||||
func NewIndex(name string, indexType int) *Index {
|
||||
return &Index{true, name, indexType, make([]string, 0)}
|
||||
}
|
||||
|
Reference in New Issue
Block a user