Fix some storage definitions

This commit is contained in:
Melody Becker 2025-03-29 17:51:42 +01:00
parent a73519f5f8
commit e282f124c7
No known key found for this signature in database
2 changed files with 10 additions and 7 deletions

View file

@ -4,9 +4,11 @@ import "time"
// A token used during the login process
// Each user may only have at most one login process active at the same time
// Technically, that could be used to permanently block someone from logging in
// by starting a new login process every time the target has just started one
type LoginProcessToken struct {
User User
UserId string
UserId string `gorm:"unique"`
Token string `gorm:"primarykey;type:uuid;default:gen_random_uuid()"`
ExpiresAt time.Time
}

View file

@ -1,6 +1,7 @@
package models
import (
"database/sql"
"time"
"gorm.io/gorm"
@ -50,17 +51,17 @@ type User struct {
Icon MediaMetadata
IconId string // ID of a media file used as icon
Background *MediaMetadata
BackgroundId *string // ID of a media file used as background image
BackgroundId sql.NullString // ID of a media file used as background image
Banner *MediaMetadata
BannerId *string // ID of a media file used as banner
BannerId sql.NullString // ID of a media file used as banner
Indexable bool // Whether this account can be found by crawlers
PublicKey []byte // The public key of the account
// Whether this account restricts following
// If true, the owner must approve of a follow request first
RestrictedFollow bool
Location *string
Birthday *time.Time
Location sql.NullString
Birthday sql.NullTime
// Whether the account got verified and is allowed to be active
// For local accounts being active means being allowed to login and perform interactions