chore(storage): run gorm gen
This commit is contained in:
parent
3f5df241db
commit
427675f38e
22 changed files with 554 additions and 174 deletions
|
@ -28,11 +28,24 @@ func newUserToPronoun(db *gorm.DB, opts ...gen.DOOption) userToPronoun {
|
|||
_userToPronoun.ALL = field.NewAsterisk(tableName)
|
||||
_userToPronoun.ID = field.NewUint64(tableName, "id")
|
||||
_userToPronoun.UserId = field.NewString(tableName, "user_id")
|
||||
_userToPronoun.Pronoung = field.NewString(tableName, "pronoung")
|
||||
_userToPronoun.Pronoun = field.NewString(tableName, "pronoun")
|
||||
_userToPronoun.User = userToPronounBelongsToUser{
|
||||
db: db.Session(&gorm.Session{}),
|
||||
|
||||
RelationField: field.NewRelation("User", "models.User"),
|
||||
Server: struct {
|
||||
field.RelationField
|
||||
Icon struct {
|
||||
field.RelationField
|
||||
}
|
||||
}{
|
||||
RelationField: field.NewRelation("User.Server", "models.RemoteServer"),
|
||||
Icon: struct {
|
||||
field.RelationField
|
||||
}{
|
||||
RelationField: field.NewRelation("User.Server.Icon", "models.MediaMetadata"),
|
||||
},
|
||||
},
|
||||
Icon: struct {
|
||||
field.RelationField
|
||||
}{
|
||||
|
@ -178,11 +191,11 @@ func newUserToPronoun(db *gorm.DB, opts ...gen.DOOption) userToPronoun {
|
|||
type userToPronoun struct {
|
||||
userToPronounDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Uint64
|
||||
UserId field.String
|
||||
Pronoung field.String
|
||||
User userToPronounBelongsToUser
|
||||
ALL field.Asterisk
|
||||
ID field.Uint64
|
||||
UserId field.String
|
||||
Pronoun field.String
|
||||
User userToPronounBelongsToUser
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
@ -201,7 +214,7 @@ func (u *userToPronoun) updateTableName(table string) *userToPronoun {
|
|||
u.ALL = field.NewAsterisk(table)
|
||||
u.ID = field.NewUint64(table, "id")
|
||||
u.UserId = field.NewString(table, "user_id")
|
||||
u.Pronoung = field.NewString(table, "pronoung")
|
||||
u.Pronoun = field.NewString(table, "pronoun")
|
||||
|
||||
u.fillFieldMap()
|
||||
|
||||
|
@ -221,7 +234,7 @@ func (u *userToPronoun) fillFieldMap() {
|
|||
u.fieldMap = make(map[string]field.Expr, 4)
|
||||
u.fieldMap["id"] = u.ID
|
||||
u.fieldMap["user_id"] = u.UserId
|
||||
u.fieldMap["pronoung"] = u.Pronoung
|
||||
u.fieldMap["pronoun"] = u.Pronoun
|
||||
|
||||
}
|
||||
|
||||
|
@ -240,6 +253,12 @@ type userToPronounBelongsToUser struct {
|
|||
|
||||
field.RelationField
|
||||
|
||||
Server struct {
|
||||
field.RelationField
|
||||
Icon struct {
|
||||
field.RelationField
|
||||
}
|
||||
}
|
||||
Icon struct {
|
||||
field.RelationField
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue