1
0

Implemented creating a team <-> list relation

This commit is contained in:
kolaente
2018-07-24 17:29:13 +02:00
committed by konrad
parent 6ff10e6353
commit edf9b6f2c7
12 changed files with 113 additions and 48 deletions

View File

@ -60,22 +60,6 @@ type TeamUser struct {
IsAdmin bool `json:"is_admin"`
}
// TeamList defines the relation between a team and a list
type TeamList struct {
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id"`
TeamID int64 `xorm:"int(11) not null" json:"team_id"`
ListID int64 `xorm:"int(11) not null" json:"list_id"`
Rights int `xorm:"varchar(250)" json:"rights"`
Created int64 `xorm:"created" json:"created"`
Updated int64 `xorm:"updated" json:"updated"`
}
// TableName makes beautiful table names
func (TeamList) TableName() string {
return "team_list"
}
// GetAllTeamsByNamespaceID returns all teams for a namespace
func GetAllTeamsByNamespaceID(id int64) (teams []*Team, err error) {
err = x.Table("teams").