diff options
author | 2021-09-10 09:08:21 +0100 | |
---|---|---|
committer | 2021-09-10 10:08:21 +0200 | |
commit | 4c4a622088ef1db208930deb2d00cd1b2bcd708f (patch) | |
tree | 2662782d3bf6ec3541e0132e3c225114bdfe364f /internal/gtsmodel/mediaattachment.go | |
parent | fix up status inreplyto visibility, + small format improvements (#199) (diff) | |
download | gotosocial-4c4a622088ef1db208930deb2d00cd1b2bcd708f.tar.xz |
Prune unnecessary nullzeros, fixup db tags (#200)
* prune gtsmodel.Account bun tags, add note to gtsmodel dir
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
* further database tag fixes
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
* more db tag fixups
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
* fix removing nullzero for account timestamps...
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
* add nullzero back to accountid tag
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
* rename gtsmodel readme
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
Diffstat (limited to 'internal/gtsmodel/mediaattachment.go')
-rw-r--r-- | internal/gtsmodel/mediaattachment.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/gtsmodel/mediaattachment.go b/internal/gtsmodel/mediaattachment.go index 59cf8aac1..4c7e0f843 100644 --- a/internal/gtsmodel/mediaattachment.go +++ b/internal/gtsmodel/mediaattachment.go @@ -31,11 +31,11 @@ type MediaAttachment struct { StatusID string `validate:"omitempty,ulid" bun:"type:CHAR(26),nullzero"` // ID of the status to which this is attached URL string `validate:"required_without=RemoteURL,omitempty,url" bun:",nullzero"` // Where can the attachment be retrieved on *this* server RemoteURL string `validate:"required_without=URL,omitempty,url" bun:",nullzero"` // Where can the attachment be retrieved on a remote server (empty for local media) - Type FileType `validate:"oneof=Image Gif Audio Video Unknown" bun:",notnull"` // Type of file (image/gif/audio/video) + Type FileType `validate:"oneof=Image Gif Audio Video Unknown" bun:",nullzero,notnull"` // Type of file (image/gif/audio/video) FileMeta FileMeta `validate:"required" bun:",nullzero,notnull"` // Metadata about the file AccountID string `validate:"required,ulid" bun:"type:CHAR(26),nullzero,notnull"` // To which account does this attachment belong Account *Account `validate:"-" bun:"rel:has-one"` // Account corresponding to accountID - Description string `validate:"-" bun:",nullzero"` // Description of the attachment (for screenreaders) + Description string `validate:"-" bun:""` // Description of the attachment (for screenreaders) ScheduledStatusID string `validate:"omitempty,ulid" bun:"type:CHAR(26),nullzero"` // To which scheduled status does this attachment belong Blurhash string `validate:"required_if=Type Image,required_if=Type Gif,required_if=Type Video" bun:",nullzero"` // What is the generated blurhash of this attachment Processing ProcessingStatus `validate:"oneof=0 1 2 666" bun:",notnull,default:2"` // What is the processing status of this attachment @@ -49,7 +49,7 @@ type MediaAttachment struct { type File struct { Path string `validate:"required,file" bun:",nullzero,notnull"` // Path of the file in storage. ContentType string `validate:"required" bun:",nullzero,notnull"` // MIME content type of the file. - FileSize int `validate:"required" bun:",nullzero,notnull"` // File size in bytes + FileSize int `validate:"required" bun:",notnull"` // File size in bytes UpdatedAt time.Time `validate:"-" bun:"type:timestamp,nullzero,notnull,default:current_timestamp"` // When was the file last updated. } @@ -57,7 +57,7 @@ type File struct { type Thumbnail struct { Path string `validate:"required,file" bun:",nullzero,notnull"` // Path of the file in storage. ContentType string `validate:"required" bun:",nullzero,notnull"` // MIME content type of the file. - FileSize int `validate:"required" bun:",nullzero,notnull"` // File size in bytes + FileSize int `validate:"required" bun:",notnull"` // File size in bytes UpdatedAt time.Time `validate:"-" bun:"type:timestamp,nullzero,notnull,default:current_timestamp"` // When was the file last updated. URL string `validate:"required_without=RemoteURL,omitempty,url" bun:",nullzero"` // What is the URL of the thumbnail on the local server RemoteURL string `validate:"required_without=URL,omitempty,url" bun:",nullzero"` // What is the remote URL of the thumbnail (empty for local media) |