[feature] migrate to monorepo
This commit is contained in:
commit
05ddc1f783
267 changed files with 75165 additions and 0 deletions
41
backend/ent/schema/dailycategorycontent.go
Normal file
41
backend/ent/schema/dailycategorycontent.go
Normal file
|
@ -0,0 +1,41 @@
|
|||
package schema
|
||||
|
||||
import (
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/schema/field"
|
||||
"entgo.io/ent/schema/edge"
|
||||
"entgo.io/ent/schema/index"
|
||||
)
|
||||
|
||||
// DailyCategoryContent holds the schema definition for the DailyCategoryContent entity.
|
||||
type DailyCategoryContent struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
// Fields of the DailyCategoryContent.
|
||||
func (DailyCategoryContent) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Enum("language_code").
|
||||
Values("en", "zh-Hans", "zh-Hant"),
|
||||
field.String("name").
|
||||
NotEmpty(),
|
||||
}
|
||||
}
|
||||
|
||||
// Edges of the DailyCategoryContent.
|
||||
func (DailyCategoryContent) Edges() []ent.Edge {
|
||||
return []ent.Edge{
|
||||
edge.From("category", DailyCategory.Type).
|
||||
Ref("contents").
|
||||
Unique(),
|
||||
}
|
||||
}
|
||||
|
||||
// Indexes of the DailyCategoryContent.
|
||||
func (DailyCategoryContent) Indexes() []ent.Index {
|
||||
return []ent.Index{
|
||||
index.Fields("language_code").
|
||||
Edges("category").
|
||||
Unique(),
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue