The schemas were incomplete (empty stubs). Restored complete schemas from git history including refresh_token and user_role schemas, and proper field definitions for auditlog and user entities.
35 lines
691 B
Go
35 lines
691 B
Go
package schema
|
|
|
|
import (
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/edge"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
// RolePermission holds the schema definition for the RolePermission entity (many-to-many relationship).
|
|
type RolePermission struct {
|
|
ent.Schema
|
|
}
|
|
|
|
// Fields of the RolePermission.
|
|
func (RolePermission) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.String("role_id"),
|
|
field.String("permission_id"),
|
|
}
|
|
}
|
|
|
|
// Edges of the RolePermission.
|
|
func (RolePermission) Edges() []ent.Edge {
|
|
return []ent.Edge{
|
|
edge.To("role", Role.Type).
|
|
Unique().
|
|
Required().
|
|
Field("role_id"),
|
|
edge.To("permission", Permission.Type).
|
|
Unique().
|
|
Required().
|
|
Field("permission_id"),
|
|
}
|
|
}
|