2023-10-27 09:51:58 +00:00
|
|
|
package schema
|
|
|
|
|
|
|
|
import (
|
|
|
|
"entgo.io/ent"
|
|
|
|
"entgo.io/ent/schema/edge"
|
|
|
|
"entgo.io/ent/schema/field"
|
|
|
|
)
|
|
|
|
|
|
|
|
// BusinessCategory holds the schema definition for the BusinessCategory entity.
|
|
|
|
type BusinessCategory struct {
|
|
|
|
ent.Schema
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fields of the BusinessCategory.
|
|
|
|
func (BusinessCategory) Fields() []ent.Field {
|
|
|
|
return []ent.Field{
|
2023-10-28 23:12:07 +00:00
|
|
|
field.String("slug").Unique(),
|
|
|
|
field.String("name").Default("unknown"),
|
|
|
|
field.Text("description").Default("unknown"),
|
2023-10-27 09:51:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Edges of the BusinessCategory.
|
|
|
|
func (BusinessCategory) Edges() []ent.Edge {
|
|
|
|
return []ent.Edge{
|
|
|
|
edge.To("businesses", Business.Type),
|
|
|
|
}
|
|
|
|
}
|