legalgo-BE-go/database/news_model.go

18 lines
646 B
Go

package database
import (
"time"
)
type News struct {
ID string `gorm:"primaryKey" json:"id"`
AuthorID string `gorm:"not null" json:"author_id"`
Title string `gorm:"default:null" json:"title"`
Content string `gorm:"default:null" json:"content"`
IsPremium bool `gorm:"default:false" json:"is_premium"`
Slug string `gorm:"default:null" json:"slug"`
FeaturedImage string `gorm:"default:null" json:"featured_image"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
}