Files
asset-tracker/internal/model/category.go

14 lines
516 B
Go

package model
import "time"
type Category struct {
ID uint `json:"id" gorm:"primaryKey"`
UserID uint `json:"user_id" gorm:"not null;uniqueIndex:uidx_categories_user_name,priority:1;index"`
Name string `json:"name" gorm:"size:128;not null;uniqueIndex:uidx_categories_user_name,priority:2"`
Type string `json:"type" gorm:"size:16;not null"`
Color string `json:"color" gorm:"size:32"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}