feat(schema): restore complete Ent schema files

This commit is contained in:
2025-11-07 09:03:43 +01:00
parent 1f8c2626dc
commit 0912f0f81b
14 changed files with 553 additions and 9 deletions

View File

@@ -0,0 +1,32 @@
package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
)
// Permission holds the schema definition for the Permission entity.
type Permission struct {
ent.Schema
}
// Fields of the Permission.
func (Permission) Fields() []ent.Field {
return []ent.Field{
field.String("id").
Unique().
Immutable(),
field.String("name").
Unique().
NotEmpty().
Comment("Format: module.resource.action"),
}
}
// Edges of the Permission.
func (Permission) Edges() []ent.Edge {
return []ent.Edge{
edge.To("role_permissions", RolePermission.Type),
}
}