diff --git a/storage-new/models/MediaMetadata.go b/storage-new/models/MediaMetadata.go index 64d9aab..ef93ca1 100644 --- a/storage-new/models/MediaMetadata.go +++ b/storage-new/models/MediaMetadata.go @@ -12,7 +12,7 @@ import ( // Instead, they are either stored on the remote server they originated from // or an s3 bucket if uploaded to Linstrom. type MediaMetadata struct { - ID string `gorm:"primarykey;type:uuid;default:gen_random_uuid()"` // The unique ID of this media file + ID string `gorm:"primarykey;default:gen_random_uuid()"` // 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) diff --git a/storage-new/models/Note.go b/storage-new/models/Note.go index efc725f..a2af5b2 100644 --- a/storage-new/models/Note.go +++ b/storage-new/models/Note.go @@ -9,7 +9,7 @@ import ( // A note describes some user generated text content. type Note struct { - ID string `gorm:"primarykey;type:uuid;default:gen_random_uuid()"` // Make ID a string (uuid) for other implementations + ID string `gorm:"primarykey;default:gen_random_uuid()"` // 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) diff --git a/storage-new/models/User.go b/storage-new/models/User.go index ee5402b..53aaf3f 100644 --- a/storage-new/models/User.go +++ b/storage-new/models/User.go @@ -25,35 +25,35 @@ type User struct { // identifier for users and other servers, especially when changing the username // (username != display name) might be a future feature // Same also applies for other types that use a UUID as primary key - ID string `gorm:"primarykey;type:uuid;default:gen_random_uuid()" json:"id"` + ID string `gorm:"primarykey;default:gen_random_uuid()" json:"id"` // Username of the user (eg "max" if the full username is @max@example.com) // Assume unchangable (once set by a user) to be kind to other implementations // Would be an easy avenue to fuck with them though - Username string `gorm:"unique" json:"username"` - CreatedAt time.Time ` json:"created_at"` // When this entry was created. Automatically set by gorm + Username string `gorm:"unique" json:"username"` + CreatedAt time.Time ` json:"created_at"` // When this entry was created. Automatically set by gorm // When this account was last updated. Will also be used for refreshing remote accounts. Automatically set by gorm - UpdatedAt time.Time ` json:"updated_at"` + UpdatedAt time.Time ` json:"updated_at"` // 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" json:"deleted_at"` - Server RemoteServer ` json:"-"` - ServerId uint ` json:"server_id"` // Id of the server this user is from, needed for including RemoteServer - DisplayName string ` json:"display_name"` // The display name of the user. Can be different from the handle - Description string ` json:"description"` // The description of a user account - IsBot bool ` json:"is_bot"` // Whether to mark this account as a script controlled one - Icon *MediaMetadata ` json:"-"` - IconId sql.NullString ` json:"icon_id"` // ID of a media file used as icon - Background *MediaMetadata ` json:"-"` - BackgroundId sql.NullString ` json:"background_id"` // ID of a media file used as background image - Banner *MediaMetadata ` json:"-"` - BannerId sql.NullString ` json:"banner_id"` // ID of a media file used as banner - Indexable bool ` json:"indexable"` // Whether this account can be found by crawlers - PublicKeyRsa []byte ` json:"public_key_rsa"` // The public RSA key of the account - PublicKeyEd []byte ` json:"public_key_ed"` // The public Ed25519 key of the account + DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"` + Server RemoteServer ` json:"-"` + ServerId uint ` json:"server_id"` // Id of the server this user is from, needed for including RemoteServer + DisplayName string ` json:"display_name"` // The display name of the user. Can be different from the handle + Description string ` json:"description"` // The description of a user account + IsBot bool ` json:"is_bot"` // Whether to mark this account as a script controlled one + Icon *MediaMetadata ` json:"-"` + IconId sql.NullString ` json:"icon_id"` // ID of a media file used as icon + Background *MediaMetadata ` json:"-"` + BackgroundId sql.NullString ` json:"background_id"` // ID of a media file used as background image + Banner *MediaMetadata ` json:"-"` + BannerId sql.NullString ` json:"banner_id"` // ID of a media file used as banner + Indexable bool ` json:"indexable"` // Whether this account can be found by crawlers + PublicKeyRsa []byte ` json:"public_key_rsa"` // The public RSA key of the account + PublicKeyEd []byte ` json:"public_key_ed"` // The public Ed25519 key of the account // Whether this account restricts following // If true, the owner must approve of a follow request first - RestrictedFollow bool ` json:"restricted_follow"` + RestrictedFollow bool ` json:"restricted_follow"` Location sql.NullString `json:"location"` Birthday sql.NullTime `json:"birthday"`