entity

package
v0.0.0-...-a54da22 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Project

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

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

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

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

Jump to

Keyboard shortcuts

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