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:
parent
0639cde4f2
commit
714f528641
27 changed files with 983 additions and 0 deletions
33
storage-new/models/Note.go
Normal file
33
storage-new/models/Note.go
Normal file
|
@ -0,0 +1,33 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// Data defined in extra structs:
|
||||
// - Attachments: models.NoteToAttachment
|
||||
// - Emotes: models.NoteToEmote
|
||||
// - Pings: models.NoteToPing
|
||||
// - Tags: models.NoteTag
|
||||
type Note struct {
|
||||
ID string `gorm:"primarykey"` // Make ID a string (uuid) for other implementations
|
||||
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"`
|
||||
// Creator Account // `gorm:"foreignKey:CreatorId;references:ID"` // Account that created the post
|
||||
CreatorId string
|
||||
Remote bool // Whether the note is originally a remote one and just "cached"
|
||||
// Raw content of the note. So without additional formatting applied
|
||||
// Might already have formatting applied beforehand from the origin server
|
||||
RawContent string
|
||||
ContentWarning *string // Content warnings of the note, if it contains any
|
||||
RepliesTo *string // Url of the message this replies to
|
||||
Quotes *string // url of the message this note quotes
|
||||
AccessLevel NoteAccessLevel // Where to send this message to (public, home, followers, dm)
|
||||
OriginServer string // Url of the origin server. Also the primary key for those
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue