This repository has been archived on 2023-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
imagini/internal/db/models.go

45 lines
787 B
Go
Raw Normal View History

2021-01-06 19:36:09 +00:00
package db
import (
"gorm.io/gorm"
"time"
)
type ServerSetting struct {
gorm.Model
Name string
Description string
Value string
}
type User struct {
gorm.Model
Name string
Email string
AuthType string
Salt string
HashedPWSalt string
}
type MediaItem struct {
gorm.Model
2021-01-08 02:45:59 +00:00
User User `gorm:"ForeignKey:ID"`
2021-01-06 19:36:09 +00:00
EXIFDate time.Time
Latitude string
Longitude string
MediaType uint
RelPath string
Tags []Tag `gorm:"many2many:media_tags;"`
Albums []Album `gorm:"many2many:media_albums;"`
}
type Tag struct {
gorm.Model
Name string
}
type Album struct {
gorm.Model
Name string
}