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