package
Version:
v0.0.0-...-b2769b5
Opens a new window with list of versions in this module.
Published: Apr 5, 2022
License: GPL-3.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
DBMigrate will create and migrate the tables, and then make the some relationships if necessary
type Project struct {
gorm.Model
Title string `gorm:"unique" json:"title"`
Archived bool `json:"archived"`
Tasks []Task `gorm:"ForeignKey:ProjectID" json:"tasks"`
}
type Task 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"`
ProjectID uint `json:"project_id"`
}
func (t *Task) Complete()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.