legalgo-BE-go/database/category_model.go
2025-03-05 23:55:41 +08:00

17 lines
493 B
Go

package database
import (
"time"
)
type Category struct {
ID string `gorm:"primaryKey" json:"id"`
Name string `gorm:"not null" json:"name"`
Code string `gorm:"not null;unique" json:"code"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
DeletedAt time.Time `gorm:"default:null" json:"deleted_at"`
News []News `gorm:"many2many:news_categories" json:"news"`
}