Add IDs to the various connector structs
This commit is contained in:
parent
582988add2
commit
c9e1881f55
11 changed files with 13 additions and 1 deletions
|
@ -2,6 +2,7 @@ package models
|
|||
|
||||
// A binding of one note to one media attachment
|
||||
type NoteToAttachment struct {
|
||||
ID uint64 `gorm:"primarykey"`
|
||||
Note Note
|
||||
NoteId string
|
||||
Attachment MediaMetadata
|
||||
|
|
|
@ -2,6 +2,7 @@ package models
|
|||
|
||||
// A binding of one note to one emote
|
||||
type NoteToEmote struct {
|
||||
ID uint64 `gorm:"primarykey"`
|
||||
Note Note
|
||||
NoteId string
|
||||
Emote Emote
|
||||
|
|
|
@ -2,6 +2,7 @@ package models
|
|||
|
||||
// A binding of one note to one mentioned account
|
||||
type NoteToPing struct {
|
||||
ID uint64 `gorm:"primarykey"`
|
||||
Note Note
|
||||
NoteId string
|
||||
PingTarget User
|
||||
|
|
|
@ -2,6 +2,7 @@ package models
|
|||
|
||||
// A binding of one note to one string (hash)tag
|
||||
type NoteTag struct {
|
||||
ID uint64 `gorm:"primarykey"`
|
||||
Note Note
|
||||
NoteId string
|
||||
Tag string
|
||||
|
|
|
@ -7,8 +7,10 @@ import "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 {
|
||||
ID uint64 `gorm:"primarykey"`
|
||||
User User
|
||||
UserId string `gorm:"unique"`
|
||||
Token string `gorm:"primarykey;type:uuid;default:gen_random_uuid()"`
|
||||
Token string `gorm:"type:uuid;default:gen_random_uuid()"`
|
||||
Name string
|
||||
ExpiresAt time.Time
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package models
|
|||
//
|
||||
// Password hashes may only exist at most once per user, the rest 0-m
|
||||
type UserAuthMethod struct {
|
||||
ID uint64 `gorm:"primarykey"`
|
||||
User User
|
||||
UserId string
|
||||
AuthMethod AuthenticationMethodType `gorm:"type:auth_method_type"`
|
||||
|
|
|
@ -3,6 +3,7 @@ package models
|
|||
// Defines an account to be a being of the set type
|
||||
// Multiple are possible for combination
|
||||
type UserToBeing struct {
|
||||
ID uint64 `gorm:"primarykey"`
|
||||
User User
|
||||
UserId string
|
||||
Being BeingType `gorm:"type:being_type"`
|
||||
|
|
|
@ -3,6 +3,7 @@ package models
|
|||
// A (hash)tag appearing on an account's profile description
|
||||
// Accounts may have multiple tags, but each tag may only be stored once at most
|
||||
type UserToTag struct {
|
||||
ID uint64 `gorm:"primarykey"`
|
||||
User User
|
||||
UserId string
|
||||
Tag string
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package models
|
||||
|
||||
type UserToPronoun struct {
|
||||
ID uint64 `gorm:"primarykey"`
|
||||
User User
|
||||
UserId string
|
||||
Pronoung string
|
||||
|
|
|
@ -4,6 +4,7 @@ package models
|
|||
// There may be multiple of these links per user and per role
|
||||
// But a role may only be linked at most once to the same user
|
||||
type UserToRole struct {
|
||||
ID uint64 `gorm:"primarykey"`
|
||||
User User
|
||||
UserId string
|
||||
Role Role
|
||||
|
|
|
@ -4,6 +4,7 @@ package models
|
|||
// There may be multiple relations from an account X to an account Y,
|
||||
// each describing a different aspect
|
||||
type UserToUserRelation struct {
|
||||
ID uint64 `gorm:"primarykey"`
|
||||
User User
|
||||
UserId string
|
||||
TargetUser User
|
||||
|
|
Loading…
Reference in a new issue