otter-space-sdk/pkg/models/post.go
SoXX 85d7905e8a refactor: renamed variables
- Update model references from `UserFavorites` to `UserFavorite` in multiple files.
- Adjust database queries and struct definitions accordingly to maintain consistency.
2024-08-09 22:43:58 +02:00

15 lines
420 B
Go

package models
// Post model
type Post struct {
BaseModel[PostID]
Rating Rating `json:"rating" gorm:"type:enum('safe','questionable','explicit')"`
Tags []Tag `json:"-" gorm:"many2many:post_tags;"`
Favorites []UserFavorite `json:"-" gorm:"foreignKey:PostID"`
References []PostReference `json:"references" gorm:"foreignKey:PostID"`
}
func (Post) TableName() string {
return "Post"
}