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
625 B
Go
35 lines
625 B
Go
package schema
|
|
|
|
import (
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/edge"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
// UserRole holds the schema definition for the UserRole entity (many-to-many relationship).
|
|
type UserRole struct {
|
|
ent.Schema
|
|
}
|
|
|
|
// Fields of the UserRole.
|
|
func (UserRole) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.String("user_id"),
|
|
field.String("role_id"),
|
|
}
|
|
}
|
|
|
|
// Edges of the UserRole.
|
|
func (UserRole) Edges() []ent.Edge {
|
|
return []ent.Edge{
|
|
edge.To("user", User.Type).
|
|
Unique().
|
|
Required().
|
|
Field("user_id"),
|
|
edge.To("role", Role.Type).
|
|
Unique().
|
|
Required().
|
|
Field("role_id"),
|
|
}
|
|
}
|