init
This commit is contained in:
18
models/category.go
Normal file
18
models/category.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Category struct {
|
||||
ID uuid.UUID `gorm:"primaryKey" json:"id"`
|
||||
ServerID uuid.UUID `gorm:"index;not null" json:"server_id"`
|
||||
Name string `gorm:"not null" json:"name"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
|
||||
|
||||
// Relation optionnelle vers le serveur
|
||||
Server *Server `gorm:"foreignKey:ServerID" json:"server,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user