Reorganization of backend + new routes

This commit is contained in:
cdricms
2025-01-29 18:09:41 +01:00
parent 7c66353e63
commit 8110172a38
67 changed files with 1124 additions and 400 deletions

View 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"`
}