mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-22 23:53:42 +08:00
added index to IssueDependency
This commit is contained in:
parent
40c3343016
commit
611cccb471
models
|
@ -107,8 +107,8 @@ func (err ErrUnknownDependencyType) Unwrap() error {
|
||||||
type IssueDependency struct {
|
type IssueDependency struct {
|
||||||
ID int64 `xorm:"pk autoincr"`
|
ID int64 `xorm:"pk autoincr"`
|
||||||
UserID int64 `xorm:"NOT NULL"`
|
UserID int64 `xorm:"NOT NULL"`
|
||||||
IssueID int64 `xorm:"UNIQUE(issue_dependency) NOT NULL"`
|
IssueID int64 `xorm:"UNIQUE(issue_dependency) NOT NULL index"`
|
||||||
DependencyID int64 `xorm:"UNIQUE(issue_dependency) NOT NULL"`
|
DependencyID int64 `xorm:"UNIQUE(issue_dependency) NOT NULL index"`
|
||||||
CreatedUnix timeutil.TimeStamp `xorm:"created"`
|
CreatedUnix timeutil.TimeStamp `xorm:"created"`
|
||||||
UpdatedUnix timeutil.TimeStamp `xorm:"updated"`
|
UpdatedUnix timeutil.TimeStamp `xorm:"updated"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -566,6 +566,8 @@ var migrations = []Migration{
|
||||||
NewMigration("Add default_wiki_branch to repository table", v1_22.AddDefaultWikiBranch),
|
NewMigration("Add default_wiki_branch to repository table", v1_22.AddDefaultWikiBranch),
|
||||||
// v290 -> v291
|
// v290 -> v291
|
||||||
NewMigration("Add PayloadVersion to HookTask", v1_22.AddPayloadVersionToHookTaskTable),
|
NewMigration("Add PayloadVersion to HookTask", v1_22.AddPayloadVersionToHookTaskTable),
|
||||||
|
// v291 -> v292
|
||||||
|
NewMigration("Add indecies to IssueDependency", v1_22.AddIndeciesToIssueDepencencies),
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCurrentDBVersion returns the current db version
|
// GetCurrentDBVersion returns the current db version
|
||||||
|
|
17
models/migrations/v1_22/v291.go
Normal file
17
models/migrations/v1_22/v291.go
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
package v1_22 //nolint
|
||||||
|
|
||||||
|
import (
|
||||||
|
"xorm.io/xorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
func AddIndeciesToIssueDepencencies(x *xorm.Engine) error {
|
||||||
|
type IssueDependency struct {
|
||||||
|
IssueID int64 `xorm:"UNIQUE(issue_dependency) NOT NULL index"`
|
||||||
|
DependencyID int64 `xorm:"UNIQUE(issue_dependency) NOT NULL index"`
|
||||||
|
}
|
||||||
|
|
||||||
|
return x.Sync(&IssueDependency{})
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user