Rework backing storage system
Some checks are pending
/ test (push) Waiting to run

Step one: Copy the struct definitions over into a new, dedicated
submodule
Step two: Make a generator script
Step three: Define helper functions for various queries
This commit is contained in:
Melody Becker 2025-03-20 21:39:10 +01:00
parent 0639cde4f2
commit 714f528641
Signed by: mstar
SSH key fingerprint: SHA256:vkXfS9FG2pVNVfvDrzd1VW9n8VJzqqdKQGljxxX8uK8
27 changed files with 983 additions and 0 deletions

View file

@ -0,0 +1,29 @@
package models
import (
"time"
"gorm.io/gorm"
)
type MediaMetadata struct {
ID string `gorm:"primarykey"` // The unique ID of this media file
CreatedAt time.Time // When this entry was created
UpdatedAt time.Time // When this entry was last updated
// When this entry was deleted (for soft deletions)
// Soft delete means that this entry still exists in the db, but gorm won't include it anymore unless specifically told to
// If not null, this entry is marked as deleted
DeletedAt gorm.DeletedAt `gorm:"index"`
OwnedBy string // Account id this media belongs to
Remote bool // whether the attachment is a remote one
// Where the media is stored. Url
Location string
Type string // What media type this is following mime types, eg image/png
// Name of the file
// Could be <emote-name>.png, <server-name>.webp for example. Or the name the file was uploaded with
Name string
// Alternative description of the media file's content
AltText string
// Whether the media is to be blurred by default
Blurred bool
}