Addded indecies everywhere

This commit is contained in:
kolaente 2018-10-05 18:46:01 +02:00
parent 1139eee2ad
commit 358b569bf1
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
8 changed files with 23 additions and 23 deletions

View file

@ -5,8 +5,8 @@ type List struct {
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"list"` ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"list"`
Title string `xorm:"varchar(250)" json:"title"` Title string `xorm:"varchar(250)" json:"title"`
Description string `xorm:"varchar(1000)" json:"description"` Description string `xorm:"varchar(1000)" json:"description"`
OwnerID int64 `xorm:"int(11)" json:"-"` OwnerID int64 `xorm:"int(11) INDEX" json:"-"`
NamespaceID int64 `xorm:"int(11)" json:"-" param:"namespace"` NamespaceID int64 `xorm:"int(11) INDEX" json:"-" param:"namespace"`
Owner User `xorm:"-" json:"owner"` Owner User `xorm:"-" json:"owner"`
Tasks []*ListTask `xorm:"-" json:"tasks"` Tasks []*ListTask `xorm:"-" json:"tasks"`

View file

@ -5,11 +5,11 @@ type ListTask struct {
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"listtask"` ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"listtask"`
Text string `xorm:"varchar(250)" json:"text"` Text string `xorm:"varchar(250)" json:"text"`
Description string `xorm:"varchar(250)" json:"description"` Description string `xorm:"varchar(250)" json:"description"`
Done bool `json:"done"` Done bool `xorm:"INDEX" json:"done"`
DueDateUnix int64 `xorm:"int(11)" json:"dueDate"` DueDateUnix int64 `xorm:"int(11) INDEX" json:"dueDate"`
ReminderUnix int64 `xorm:"int(11)" json:"reminderDate"` ReminderUnix int64 `xorm:"int(11) INDEX" json:"reminderDate"`
CreatedByID int64 `xorm:"int(11)" json:"-"` // ID of the user who put that task on the list CreatedByID int64 `xorm:"int(11)" json:"-"` // ID of the user who put that task on the list
ListID int64 `xorm:"int(11)" json:"listID" param:"list"` ListID int64 `xorm:"int(11) INDEX" json:"listID" param:"list"`
Created int64 `xorm:"created" json:"created"` Created int64 `xorm:"created" json:"created"`
Updated int64 `xorm:"updated" json:"updated"` Updated int64 `xorm:"updated" json:"updated"`

View file

@ -3,9 +3,9 @@ package models
// ListUser represents a list <-> user relation // ListUser represents a list <-> user relation
type ListUser struct { type ListUser struct {
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"namespace"` ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"namespace"`
UserID int64 `xorm:"int(11) not null" json:"user_id" param:"user"` UserID int64 `xorm:"int(11) not null INDEX" json:"user_id" param:"user"`
ListID int64 `xorm:"int(11) not null" json:"list_id" param:"list"` ListID int64 `xorm:"int(11) not null INDEX" json:"list_id" param:"list"`
Right UserRight `xorm:"int(11)" json:"right"` Right UserRight `xorm:"int(11) INDEX" json:"right"`
Created int64 `xorm:"created" json:"created"` Created int64 `xorm:"created" json:"created"`
Updated int64 `xorm:"updated" json:"updated"` Updated int64 `xorm:"updated" json:"updated"`

View file

@ -3,9 +3,9 @@ package models
// NamespaceUser represents a namespace <-> user relation // NamespaceUser represents a namespace <-> user relation
type NamespaceUser struct { type NamespaceUser struct {
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"namespace"` ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"namespace"`
UserID int64 `xorm:"int(11) not null" json:"user_id" param:"user"` UserID int64 `xorm:"int(11) not null INDEX" json:"user_id" param:"user"`
NamespaceID int64 `xorm:"int(11) not null" json:"namespace_id" param:"namespace"` NamespaceID int64 `xorm:"int(11) not null INDEX" json:"namespace_id" param:"namespace"`
Right UserRight `xorm:"int(11)" json:"right"` Right UserRight `xorm:"int(11) INDEX" json:"right"`
Created int64 `xorm:"created" json:"created"` Created int64 `xorm:"created" json:"created"`
Updated int64 `xorm:"updated" json:"updated"` Updated int64 `xorm:"updated" json:"updated"`

View file

@ -5,7 +5,7 @@ type Namespace struct {
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"namespace"` ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"namespace"`
Name string `xorm:"varchar(250)" json:"name"` Name string `xorm:"varchar(250)" json:"name"`
Description string `xorm:"varchar(1000)" json:"description"` Description string `xorm:"varchar(1000)" json:"description"`
OwnerID int64 `xorm:"int(11) not null" json:"-"` OwnerID int64 `xorm:"int(11) not null INDEX" json:"-"`
Owner User `xorm:"-" json:"owner"` Owner User `xorm:"-" json:"owner"`

View file

@ -3,9 +3,9 @@ package models
// TeamList defines the relation between a team and a list // TeamList defines the relation between a team and a list
type TeamList struct { type TeamList struct {
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id"` ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id"`
TeamID int64 `xorm:"int(11) not null" json:"team_id" param:"team"` TeamID int64 `xorm:"int(11) not null INDEX" json:"team_id" param:"team"`
ListID int64 `xorm:"int(11) not null" json:"list_id" param:"list"` ListID int64 `xorm:"int(11) not null INDEX" json:"list_id" param:"list"`
Right TeamRight `xorm:"int(11)" json:"right"` Right TeamRight `xorm:"int(11) INDEX" json:"right"`
Created int64 `xorm:"created" json:"created"` Created int64 `xorm:"created" json:"created"`
Updated int64 `xorm:"updated" json:"updated"` Updated int64 `xorm:"updated" json:"updated"`

View file

@ -3,9 +3,9 @@ package models
// TeamNamespace defines the relationship between a Team and a Namespace // TeamNamespace defines the relationship between a Team and a Namespace
type TeamNamespace struct { type TeamNamespace struct {
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id"` ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id"`
TeamID int64 `xorm:"int(11) not null" json:"team_id" param:"team"` TeamID int64 `xorm:"int(11) not null INDEX" json:"team_id" param:"team"`
NamespaceID int64 `xorm:"int(11) not null" json:"namespace_id" param:"namespace"` NamespaceID int64 `xorm:"int(11) not null INDEX" json:"namespace_id" param:"namespace"`
Right TeamRight `xorm:"int(11)" json:"right"` Right TeamRight `xorm:"int(11) INDEX" json:"right"`
Created int64 `xorm:"created" json:"created"` Created int64 `xorm:"created" json:"created"`
Updated int64 `xorm:"updated" json:"updated"` Updated int64 `xorm:"updated" json:"updated"`

View file

@ -5,7 +5,7 @@ type Team struct {
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"team"` ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id" param:"team"`
Name string `xorm:"varchar(250) not null" json:"name"` Name string `xorm:"varchar(250) not null" json:"name"`
Description string `xorm:"varchar(250)" json:"description"` Description string `xorm:"varchar(250)" json:"description"`
CreatedByID int64 `xorm:"int(11) not null" json:"-"` CreatedByID int64 `xorm:"int(11) not null INDEX" json:"-"`
CreatedBy User `xorm:"-" json:"created_by"` CreatedBy User `xorm:"-" json:"created_by"`
Members []*TeamUser `xorm:"-" json:"members"` Members []*TeamUser `xorm:"-" json:"members"`
@ -38,9 +38,9 @@ func (t *Team) AfterLoad() {
// TeamMember defines the relationship between a user and a team // TeamMember defines the relationship between a user and a team
type TeamMember struct { type TeamMember struct {
ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id"` ID int64 `xorm:"int(11) autoincr not null unique pk" json:"id"`
TeamID int64 `xorm:"int(11) not null" json:"team_id" param:"team"` TeamID int64 `xorm:"int(11) not null INDEX" json:"team_id" param:"team"`
UserID int64 `xorm:"int(11) not null" json:"user_id" param:"user"` UserID int64 `xorm:"int(11) not null INDEX" json:"user_id" param:"user"`
Admin bool `xorm:"tinyint(1)" json:"admin"` Admin bool `xorm:"tinyint(1) INDEX" json:"admin"`
Created int64 `xorm:"created" json:"created"` Created int64 `xorm:"created" json:"created"`
Updated int64 `xorm:"updated" json:"updated"` Updated int64 `xorm:"updated" json:"updated"`