Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Car ¶
type Car struct {
ID uint64 `json:"id" gorm:"primaryKey;column:id;autoIncrement"`
Name string `json:"name" gorm:"column:name;index;size:100;not null"`
Description string `json:"description" gorm:"column:description;index;size:300;not null"`
Price float64 `json:"price" gorm:"column:price;index;type:float;not null"`
}
type House ¶
type House struct {
ID uint64 `json:"id" gorm:"primaryKey;column:id;autoIncrement"`
Name string `json:"name" gorm:"column:name;index;size:100;not null"`
Description string `json:"description" gorm:"column:description;index;size:300;not null"`
Price float64 `json:"price" gorm:"column:price;index;type:float;not null"`
}
type Person ¶
type Person struct {
ID uint64 `json:"id" gorm:"primaryKey;column:id;autoIncrement"`
Name string `json:"name" gorm:"column:name;index;size:100;not null"`
Cars []*Car `json:"cars" gorm:"many2many:person_car"`
Houses []*House `json:"houses" gorm:"many2many:person_house"`
StatusList []*PersonStatus `json:"statusList" gorm:"foreignKey:PersonID"`
Locations []*PersonLocation `json:"locations" gorm:"foreignKey:PersonID"`
}
type PersonLocation ¶
type PersonLocation struct {
ID uint64 `json:"id" gorm:"primaryKey;column:id;autoIncrement"`
PersonID uint64 `json:"personId" gorm:"column:personId;index;not null"`
Person *Person `json:"person" gorm:"foreignKey:PersonID;OnUpdate:CASCADE;OnDelete:CASCADE"`
Address string `json:"address" gorm:"column:address;index;size:200;not null"`
City string `json:"city" gorm:"column:city;index;size:200;not null"`
State string `json:"state" gorm:"column:state;index;size:200;not null"`
Country string `json:"country" gorm:"column:country;index;size:200;not null"`
}
type PersonStatus ¶
type PersonStatus struct {
ID uint64 `json:"id" gorm:"primaryKey;column:id;autoIncrement"`
PersonID uint64 `json:"personId" gorm:"column:personId;index;not null"`
Person *Person `json:"person" gorm:"foreignKey:PersonID;OnUpdate:CASCADE;OnDelete:CASCADE"`
Name string `json:"name" gorm:"column:name;index;size:100;not null"`
Text string `json:"text" gorm:"column:text;index;size:200;not null"`
}
Click to show internal directories.
Click to hide internal directories.