tss-rocks/backend/ent/schema/dailycategory.go
CDN 05ddc1f783
Some checks failed
Build Backend / Build Docker Image (push) Successful in 3m33s
Test Backend / test (push) Failing after 31s
[feature] migrate to monorepo
2025-02-21 00:49:20 +08:00

32 lines
722 B
Go

package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/edge"
"time"
)
// DailyCategory holds the schema definition for the DailyCategory entity.
type DailyCategory struct {
ent.Schema
}
// Fields of the DailyCategory.
func (DailyCategory) Fields() []ent.Field {
return []ent.Field{
field.Time("created_at").
Default(time.Now),
field.Time("updated_at").
Default(time.Now).
UpdateDefault(time.Now),
}
}
// Edges of the DailyCategory.
func (DailyCategory) Edges() []ent.Edge {
return []ent.Edge{
edge.To("contents", DailyCategoryContent.Type),
edge.To("daily_items", Daily.Type),
}
}