diff --git a/server/models/role.go b/server/models/role.go index 907af43..86c69b6 100644 --- a/server/models/role.go +++ b/server/models/role.go @@ -5,5 +5,5 @@ import "gorm.io/gorm" type Role struct { gorm.Model Name string - Users []User + Users []*User `gorm:"many2many:user_roles;"` } diff --git a/server/models/user.go b/server/models/user.go index 02ceb66..63994e5 100644 --- a/server/models/user.go +++ b/server/models/user.go @@ -7,6 +7,6 @@ type User struct { UUID string Email string Password string - Roles []Role - Sessions []Session + Roles []*Role `gorm:"many2many:user_roles;"` + Sessions []*Session }