2018-09-16 17:09:40 +00:00
|
|
|
package models
|
2018-07-18 13:17:56 +00:00
|
|
|
|
|
|
|
import (
|
2018-08-09 21:10:05 +00:00
|
|
|
"time"
|
2018-10-31 06:14:33 +00:00
|
|
|
|
|
|
|
"github.com/jinzhu/gorm"
|
2018-07-18 13:17:56 +00:00
|
|
|
)
|
|
|
|
|
2018-11-06 18:02:03 +00:00
|
|
|
// A photo can have multiple images and sidecar files
|
2018-07-18 13:17:56 +00:00
|
|
|
type Photo struct {
|
|
|
|
gorm.Model
|
2018-09-27 06:59:53 +00:00
|
|
|
TakenAt time.Time
|
2018-10-08 07:26:05 +00:00
|
|
|
TakenAtChanged bool
|
2018-09-27 06:59:53 +00:00
|
|
|
PhotoTitle string
|
|
|
|
PhotoTitleChanged bool
|
|
|
|
PhotoDescription string `gorm:"type:text;"`
|
|
|
|
PhotoNotes string `gorm:"type:text;"`
|
|
|
|
PhotoArtist string
|
|
|
|
PhotoCanonicalName string
|
|
|
|
PhotoFavorite bool
|
|
|
|
PhotoLat float64
|
|
|
|
PhotoLong float64
|
|
|
|
PhotoFocalLength float64
|
|
|
|
PhotoAperture float64
|
|
|
|
Camera *Camera
|
|
|
|
CameraID uint
|
|
|
|
Lens *Lens
|
|
|
|
LensID uint
|
|
|
|
Country *Country
|
|
|
|
CountryID string
|
|
|
|
CountryChanged bool
|
|
|
|
Location *Location
|
|
|
|
LocationID uint
|
|
|
|
LocationChanged bool
|
|
|
|
Tags []*Tag `gorm:"many2many:photo_tags;"`
|
|
|
|
Files []*File
|
|
|
|
Albums []*Album `gorm:"many2many:album_photos;"`
|
2018-08-15 07:59:51 +00:00
|
|
|
}
|