Reorganization of backend + new routes
This commit is contained in:
16
backend/core/models/users_to_roles.go
Normal file
16
backend/core/models/users_to_roles.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/uptrace/bun"
|
||||
)
|
||||
|
||||
type UserToRole struct {
|
||||
bun.BaseModel `bun:"table:users_to_roles"`
|
||||
|
||||
UserID uuid.UUID `bun:"user_id,type:uuid,pk"`
|
||||
RoleID uuid.UUID `bun:"type:uuid,pk"`
|
||||
|
||||
User *User `bun:"rel:belongs-to,join:user_id=user_id"`
|
||||
Role *Role `bun:"rel:belongs-to,join:role_id=id"`
|
||||
}
|
||||
Reference in New Issue
Block a user