31 lines
1.2 KiB
Go
31 lines
1.2 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Article struct {
|
|
gorm.Model
|
|
ID uint32 `gorm:"primary_key;auto_increment;not_null"`
|
|
Title string
|
|
Body string
|
|
IsOnline bool `gorm:"not_null;default:false"`
|
|
SiteID uint32 `gorm:"index"`
|
|
Slug string `gorm:"size:100;not null;default:''"`
|
|
Excerpt string `gorm:"size:300;not null;default:''"`
|
|
SEOTitle string `gorm:"column:seo_title;size:120;not null;default:''"`
|
|
SEODescription string `gorm:"column:seo_description;size:320;not null;default:''"`
|
|
CoverImageID *uint32 `gorm:"index"`
|
|
CoverImageAlt string `gorm:"size:200;not null;default:''"`
|
|
SocialTitle string `gorm:"size:120;not null;default:''"`
|
|
SocialDescription string `gorm:"size:320;not null;default:''"`
|
|
SocialImageID *uint32 `gorm:"index"`
|
|
CanonicalURL string `gorm:"column:canonical_url;size:2048;not null;default:''"`
|
|
Noindex bool `gorm:"not null;default:false"`
|
|
SEODismissed string `gorm:"column:seo_dismissed;type:text"`
|
|
CreatedAt time.Time `gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
|
}
|