photoprism/internal/entity/category_fixtures.go

18 lines
416 B
Go
Raw Normal View History

2020-05-01 13:10:20 +02:00
package entity
var CategoryFixtures = map[string]Category{
"flower_landscape": {
2020-05-01 13:10:20 +02:00
LabelID: 1000001,
Label: LabelFixtures.Pointer("flower"),
2020-05-01 13:10:20 +02:00
CategoryID: 1000000,
Category: LabelFixtures.Pointer("landscape"),
2020-05-01 13:10:20 +02:00
},
}
// CreateCategoryFixtures inserts known entities into the database for testing.
func CreateCategoryFixtures() {
for _, entity := range CategoryFixtures {
2020-05-01 13:10:20 +02:00
Db().Create(&entity)
}
}