package models import "time" // ImageVariant is one size of a featured image on // golem15_journal_image_variants (P33-43): the thumbnail of the original at // Width by Height (Key, in the original's format) and its WebP copy // (WebPKey), both blob keys of the uploads bucket. SourceWidth and // SourceHeight are the original's size. One row per file and width, so the // API lists a post's variants with one query instead of storage lookups. type ImageVariant struct { ID uint `gorm:"column:id;primaryKey"` FileID uint `gorm:"column:file_id"` Width int `gorm:"column:width"` Height int `gorm:"column:height"` Key string `gorm:"column:key"` WebPKey string `gorm:"column:webp_key"` SourceWidth int `gorm:"column:source_width"` SourceHeight int `gorm:"column:source_height"` CreatedAt time.Time `gorm:"column:created_at"` } func (ImageVariant) TableName() string { return "golem15_journal_image_variants" } func init() { Register(ImageVariant{}) }