add new db handler with table change to reference many2many

This commit is contained in:
Adrian Zürcher
2025-11-19 16:29:37 +01:00
parent 567cc726cc
commit 2736aa1f6b
9 changed files with 103 additions and 130 deletions

View File

@@ -8,9 +8,10 @@ type User struct {
Id uint `gorm:"primaryKey" json:"id"`
Name string `gorm:"column:user_name" json:"user"`
Email string `gorm:"column:email" json:"email"`
Role string `gorm:"column:role" json:"role,omitempty"`
RoleID *uint `gorm:"column:roleId" json:"roleId,omitempty"`
Role *Role `gorm:"foreignKey:RoleID" json:"role,omitempty"`
Password string `gorm:"column:password" json:"password"`
NewPassword string `gorm:"-" json:"newPassword"`
NewPassword string `gorm:"-" json:"newPassword,omitempty"`
Expiration string `gorm:"column:expiration" json:"expiration,omitempty"`
Settings Settings `gorm:"type:json" json:"settings"`
}