feat(database): Refactor Pool model to use PoolCategory type for category field
This commit is contained in:
parent
c120c583e3
commit
9a33de96a0
@ -1,9 +1,16 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
|
type PoolCategory string
|
||||||
|
|
||||||
|
const (
|
||||||
|
Series PoolCategory = "series"
|
||||||
|
Collection PoolCategory = "collection"
|
||||||
|
)
|
||||||
|
|
||||||
type Pool struct {
|
type Pool struct {
|
||||||
BaseModel[PoolID]
|
BaseModel[PoolID]
|
||||||
Name string `json:"name" gorm:"type:varchar(25)"`
|
Name string `json:"name" gorm:"type:varchar(25)"`
|
||||||
Category string `json:"category" gorm:"type:pool_category;type:enum('series', 'collection')"`
|
Category PoolCategory `json:"category" gorm:"type:pool_category;type:enum('series', 'collection')"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Pool) TableName() string {
|
func (Pool) TableName() string {
|
||||||
|
Loading…
Reference in New Issue
Block a user