36 lines
761 B
Go
36 lines
761 B
Go
package schema
|
|
|
|
import (
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/edge"
|
|
"entgo.io/ent/schema/field"
|
|
"entgo.io/ent/schema/index"
|
|
)
|
|
|
|
// DocumentBlockChunk holds the schema definition for the DocumentBlockChunk entity.
|
|
type DocumentBlockChunk struct {
|
|
ent.Schema
|
|
}
|
|
|
|
// Fields of the DocumentBlockChunk.
|
|
func (DocumentBlockChunk) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.String("content"),
|
|
field.Int64("document_block_id"),
|
|
field.Bool("chunked").Default(false),
|
|
}
|
|
}
|
|
|
|
// Edges of the DocumentBlockChunk.
|
|
func (DocumentBlockChunk) Edges() []ent.Edge {
|
|
return []ent.Edge{
|
|
edge.To("document_block", DocumentBlock.Type),
|
|
}
|
|
}
|
|
|
|
func (DocumentBlockChunk) Indexes() []ent.Index {
|
|
return []ent.Index{
|
|
index.Fields("document_block_id", "chunked"),
|
|
}
|
|
}
|