Fix some storage definitions
This commit is contained in:
parent
a73519f5f8
commit
e282f124c7
2 changed files with 10 additions and 7 deletions
|
@ -4,9 +4,11 @@ import "time"
|
||||||
|
|
||||||
// A token used during the login process
|
// A token used during the login process
|
||||||
// Each user may only have at most one login process active at the same time
|
// 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 {
|
type LoginProcessToken struct {
|
||||||
User User
|
User User
|
||||||
UserId string
|
UserId string `gorm:"unique"`
|
||||||
Token string `gorm:"primarykey;type:uuid;default:gen_random_uuid()"`
|
Token string `gorm:"primarykey;type:uuid;default:gen_random_uuid()"`
|
||||||
ExpiresAt time.Time
|
ExpiresAt time.Time
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"database/sql"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
@ -50,17 +51,17 @@ type User struct {
|
||||||
Icon MediaMetadata
|
Icon MediaMetadata
|
||||||
IconId string // ID of a media file used as icon
|
IconId string // ID of a media file used as icon
|
||||||
Background *MediaMetadata
|
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
|
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
|
Indexable bool // Whether this account can be found by crawlers
|
||||||
PublicKey []byte // The public key of the account
|
PublicKey []byte // The public key of the account
|
||||||
// Whether this account restricts following
|
// Whether this account restricts following
|
||||||
// If true, the owner must approve of a follow request first
|
// If true, the owner must approve of a follow request first
|
||||||
RestrictedFollow bool
|
RestrictedFollow bool
|
||||||
|
|
||||||
Location *string
|
Location sql.NullString
|
||||||
Birthday *time.Time
|
Birthday sql.NullTime
|
||||||
|
|
||||||
// Whether the account got verified and is allowed to be active
|
// Whether the account got verified and is allowed to be active
|
||||||
// For local accounts being active means being allowed to login and perform interactions
|
// For local accounts being active means being allowed to login and perform interactions
|
||||||
|
|
Loading…
Reference in a new issue