model

package
v0.0.0-...-52c4e47 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBMigrate

func DBMigrate(db *gorm.DB) *gorm.DB

DBMigrate will create and migrate the tables, and then make the some relationships if necessary

Types

type FuelPart

type FuelPart struct {
	gorm.Model
	Title    string     `json:"title"`
	Priority string     `gorm:"type:ENUM('0', '1', '2', '3');default:'0'" json:"priority"`
	Deadline *time.Time `gorm:"default:null" json:"deadline"`
	Done     bool       `json:"done"`
	TankID   uint       `json:"tank_id"`
}

func (*FuelPart) Complete

func (t *FuelPart) Complete()

func (*FuelPart) Undo

func (t *FuelPart) Undo()

type Tank

type Tank struct {
	gorm.Model
	Title    string     `gorm:"unique" json:"title"`
	Archived bool       `json:"archived"`
	Fuel     []FuelPart `gorm:"ForeignKey:TankID" json:"fuel"`
}

func (*Tank) Archive

func (p *Tank) Archive()

func (*Tank) Restore

func (p *Tank) Restore()

Jump to

Keyboard shortcuts

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