models

package
v1.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 0 Imported by: 0

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"`
	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

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL