From 94587e9dfce0aed6ca47fa30322680710a5e9bc1 Mon Sep 17 00:00:00 2001 From: celogeek Date: Sat, 5 Feb 2022 21:50:59 +0100 Subject: [PATCH] rename account to author --- internal/photos/models/album.go | 2 ++ internal/photos/models/photo.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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