SoXX
0e6a8fd61e
added more columns BREAKING-CHANGE: breaks database compatibility to older SDK versions
15 lines
420 B
Go
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 []UserFavorites `json:"-" gorm:"foreignKey:PostID"`
|
|
References []PostReference `json:"references" gorm:"foreignKey:PostID"`
|
|
}
|
|
|
|
func (Post) TableName() string {
|
|
return "Post"
|
|
}
|