photoprism/internal/entity/link_fixtures.go
Michael Mayer f2955fdefc Sharing: Refactor link entity and database columns #367 #18
Add missing fields in js model and rename fields for mode clarity. A link token can be valid for multiple shares.

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-06-28 14:52:26 +02:00

26 lines
527 B
Go

package entity
import "time"
var date = time.Date(2050, 3, 6, 2, 6, 51, 0, time.UTC)
type LinkMap map[string]Link
var LinkFixtures = LinkMap{
"1jxf3jfn2k": {
LinkToken: "1jxf3jfn2k",
LinkExpires: 0,
ShareUID: "st9lxuqxpogaaba7",
CanComment: true,
CanEdit: false,
CreatedAt: time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC),
},
}
// CreateLinkFixtures inserts known entities into the database for testing.
func CreateLinkFixtures() {
for _, entity := range LinkFixtures {
Db().Create(&entity)
}
}