diff --git a/internal/photos/models/album.go b/internal/photos/models/album.go index d3f8d5a..0acc779 100644 --- a/internal/photos/models/album.go +++ b/internal/photos/models/album.go @@ -7,6 +7,8 @@ type Album struct { Name string `gorm:"not null"` Parent *Album `gorm:"constraint:OnDelete:SET NULL,OnUpdate:CASCADE"` ParentId uint32 + Author *Account `gorm:"constraint:OnDelete:SET NULL,OnUpdate:CASCADE"` + AuthorId uint32 Photos []*Photo `gorm:"many2many:album_photos"` CreatedAt time.Time UpdatedAt time.Time diff --git a/internal/photos/models/photo.go b/internal/photos/models/photo.go index 20bf699..1eb3ea6 100644 --- a/internal/photos/models/photo.go +++ b/internal/photos/models/photo.go @@ -7,8 +7,8 @@ type Photo struct { File string `gorm:"not null"` Name string `gorm:"not null"` Checksum string `gorm:"unique;size:44;not null"` - Account *Account `gorm:"constraint:OnDelete:SET NULL,OnUpdate:CASCADE"` - AccountId uint32 + Author *Account `gorm:"constraint:OnDelete:SET NULL,OnUpdate:CASCADE"` + AuthorId uint32 Albums []*Album `gorm:"many2many:album_photos"` CreatedAt time.Time UpdatedAt time.Time