36 lines
1.0 KiB
Go
36 lines
1.0 KiB
Go
|
package models
|
||
|
|
||
|
type Pool struct {
|
||
|
BaseModel[PoolID]
|
||
|
Name string `json:"name" gorm:"type:varchar(25)"`
|
||
|
Category string `json:"category" gorm:"type:pool_category;type:enum('series', 'collection')"`
|
||
|
}
|
||
|
|
||
|
func (Pool) TableName() string {
|
||
|
return "Pool"
|
||
|
}
|
||
|
|
||
|
type PoolPost struct {
|
||
|
Pool Pool `json:"pool" gorm:"foreignKey:ID;references:PoolID"`
|
||
|
PoolID PoolID `json:"pool_id" gorm:""`
|
||
|
Post Post `json:"post" gorm:"foreignKey:ID;references:PostID"`
|
||
|
PostID PostID `json:"post_id" gorm:""`
|
||
|
OrderPosition int `json:"order_position" gorm:"not null;default:0"`
|
||
|
}
|
||
|
|
||
|
func (PoolPost) TableName() string {
|
||
|
return "PoolPost"
|
||
|
}
|
||
|
|
||
|
type PoolReference struct {
|
||
|
Pool Pool `json:"pool" gorm:"foreignKey:ID;references:PoolID"`
|
||
|
PoolID PoolID `json:"pool_id" gorm:""`
|
||
|
Source Source `json:"source" gorm:"foreignKey:ID;references:SourceID"`
|
||
|
SourceID SourceID `json:"source_id" gorm:""`
|
||
|
URL string `json:"url" gorm:"not null"`
|
||
|
}
|
||
|
|
||
|
func (PoolReference) TableName() string {
|
||
|
return "PoolReference"
|
||
|
}
|