add unique indexes
This commit is contained in:
parent
4e21fc78fe
commit
498357bdd1
|
|
@ -21,8 +21,8 @@ func moveTeamUnitsToTeamUnitTable(x *xorm.Engine) error {
|
|||
// TeamUnit see models/org_team.go
|
||||
type TeamUnit struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
TeamID int64 `xorm:"INDEX(s)"`
|
||||
Type int `xorm:"INDEX(s)"`
|
||||
TeamID int64 `xorm:"UNIQUE(s)"`
|
||||
Type int `xorm:"UNIQUE(s)"`
|
||||
}
|
||||
|
||||
if err := x.Sync2(new(TeamUnit)); err != nil {
|
||||
|
|
|
|||
|
|
@ -719,8 +719,8 @@ func GetTeamsWithAccessToRepo(orgID, repoID int64, mode AccessMode) ([]*Team, er
|
|||
// TeamUnit describes all units of a repository
|
||||
type TeamUnit struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
TeamID int64 `xorm:"INDEX(s)"`
|
||||
Type UnitType `xorm:"INDEX(s)"`
|
||||
TeamID int64 `xorm:"UNIQUE(s)"`
|
||||
Type UnitType `xorm:"UNIQUE(s)"`
|
||||
}
|
||||
|
||||
// Unit returns Unit
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user