photoprism/internal/entity/location_fixtures.go

54 lines
1.3 KiB
Go
Raw Normal View History

2020-05-08 11:46:09 +02:00
package entity
import "time"
type LocationMap map[string]Location
var LocationFixtures = LocationMap{
2020-05-08 11:46:09 +02:00
"mexico": {
ID: "85d1ea7d382c",
PlaceID: PlaceFixtures.Get("teotihuacan").ID,
2020-05-08 11:46:09 +02:00
LocName: "Adosada Platform",
LocCategory: "tourism",
Place: PlaceFixtures.Pointer("teotihuacan"),
2020-05-08 11:46:09 +02:00
LocSource: "places",
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
},
"caravan park": {
ID: "1ef75a71a36c",
PlaceID: "1ef75a71a36c",
Place: &Place{
ID: "1ef75a71a36",
LocLabel: "Mandeni, KwaZulu-Natal, South Africa",
LocCity: "Mandeni",
LocState: "KwaZulu-Natal",
LocCountry: "za",
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
},
2020-05-08 11:46:09 +02:00
LocName: "Lobotes Caravan Park",
LocCategory: "camping",
LocSource: "manual",
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
},
"zinkwazi": {
ID: "1ef744d1e28c",
PlaceID: PlaceFixtures.Get("zinkwazi").ID,
Place: PlaceFixtures.Pointer("zinkwazi"),
2020-05-08 11:46:09 +02:00
LocName: "Zinkwazi Beach",
LocCategory: "",
LocSource: "places",
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
},
}
// CreateLocationFixtures inserts known entities into the database for testing.
func CreateLocationFixtures() {
for _, entity := range LocationFixtures {
Db().Create(&entity)
}
}