Discover Packages
github.com/Cyberpull/gokit
tests
models
package
Version:
v1.8.2
Opens a new window with list of versions in this module.
Published: Nov 16, 2024
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Car struct {
ID uint64 `json:"id" gorm:"primaryKey;column:id;autoIncrement"`
Brand string `gorm:"index;column:brand"`
Color string `gorm:"index;column:color"`
OwnerID uint64 `gorm:"index;column:ownerId"`
Owner *Person `gorm:"foreignKey:OwnerID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}
type Person struct {
ID uint64 `json:"id" gorm:"primaryKey;column:id;autoIncrement"`
Name string `gorm:"index;column:name"`
Cars []*Car `gorm:"foreignKey:OwnerID" gokit-dbo:"preload"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.