2024-07-19 08:03:35 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
// Post model
|
|
|
|
type Post struct {
|
2024-08-09 19:37:54 +00:00
|
|
|
BaseModel[PostID]
|
2024-07-19 08:03:35 +00:00
|
|
|
Rating Rating `json:"rating" gorm:"type:enum('safe','questionable','explicit')"`
|
|
|
|
Tags []Tag `json:"-" gorm:"many2many:post_tags;"`
|
|
|
|
Favorites []UserFavorites `json:"-" gorm:"foreignKey:PostID"`
|
|
|
|
References []PostReference `json:"references" gorm:"foreignKey:PostID"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (Post) TableName() string {
|
|
|
|
return "Post"
|
|
|
|
}
|