2022-02-05 22:11:30 +01:00

16 lines
408 B
Go

package models
import "time"
type Album struct {
ID uint32 `gorm:"primary_key"`
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
}