Discover Packages
github.com/ALTA-BE7-I-Kadek-Adi-Gunawan/todobook
internal
app
entity
package
Version:
v0.0.0-...-a54da22
Opens a new window with list of versions in this module.
Published: Apr 6, 2022
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Project struct {
gorm .Model
Name string `gorm:"type:varchar(100);not null"`
OwnerID uint `gorm:"required"`
Owner User `gorm:"foreignkey:OwnerID"`
Task []Task `gorm:"foreignkey:ProjectID"`
}
type Tag struct {
ID uint `gorm:"primary_key"`
Name string `gorm:"type:varchar(15);unique;not null"`
OwnerID uint `gorm:"required"`
Owner User `gorm:"foreignkey:OwnerID"`
Tasks []Task `gorm:"many2many:task_tags"`
}
type Task struct {
gorm .Model
Name string `gorm:"type:varchar(100);not null"`
Priority int `gorm:"type:int;not null"`
ClosedDate time .Time `gorm:"type:datetime"`
ProjectID uint `gorm:"required"`
OwnerID uint `gorm:"required"`
Owner User `gorm:"foreignkey:OwnerID"`
Project Project `gorm:"foreignkey:ProjectID"`
Tags []Tag `gorm:"many2many:task_tags;"`
}
type User struct {
gorm .Model
Name string `gorm:"type:varchar(100);not null"`
Email string `gorm:"type:varchar(100);unique;not null"`
Password string `gorm:"type:varchar(255);not null" api:"private"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.