Move account relations into separate table
This commit is contained in:
parent
c9985ba48a
commit
5546d31e5d
6 changed files with 28 additions and 20 deletions
|
@ -7,6 +7,7 @@ import "time"
|
|||
var (
|
||||
_ = linstromNote{}
|
||||
_ = linstromRole{}
|
||||
_ = linstromRelation{}
|
||||
)
|
||||
|
||||
type linstromNote struct {
|
||||
|
@ -71,8 +72,7 @@ type linstromAccount struct {
|
|||
BannerId *string `jsonapi:"attr,banner-id"`
|
||||
Background *linstromMediaMetadata `jsonapi:"relation,background"`
|
||||
BackgroundId *string `jsonapi:"attr,background-id"`
|
||||
FollowerIds []string `jsonapi:"attr,follows-ids"`
|
||||
FollowingIds []string `jsonapi:"attr,following-ids"`
|
||||
RelationIds []uint `jsonapi:"attr,follows-ids"`
|
||||
Indexable bool `jsonapi:"attr,indexable"`
|
||||
RestrictedFollow bool `jsonapi:"attr,restricted-follow"`
|
||||
IdentifiesAs []string `jsonapi:"attr,identifies-as"`
|
||||
|
@ -90,6 +90,15 @@ type linstromCustomAccountField struct {
|
|||
BelongsToId string `jsonapi:"attr,belongs-to-id"`
|
||||
}
|
||||
|
||||
type linstromRelation struct {
|
||||
Id uint `jsonapi:"primary,relations"`
|
||||
CreatedAt time.Time `jsonapi:"attr,created-at"`
|
||||
UpdatedAt time.Time `jsonapi:"attr,updated-at"`
|
||||
FromId string `jsonapi:"attr,from-id"`
|
||||
ToId string `jsonapi:"attr,to-id"`
|
||||
Accepted bool `jsonapi:"attr,accepted"`
|
||||
}
|
||||
|
||||
// Role is essentially just a carbon copy of storage/roles.go
|
||||
type linstromRole struct {
|
||||
Id uint `jsonapi:"primary,roles"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue