package schema import ( "entgo.io/ent" "entgo.io/ent/schema/field" "entgo.io/ent/schema/index" "time" ) // Document holds the schema definition for the Document entity. type Document struct { ent.Schema } // Fields of the Document. func (Document) Fields() []ent.Field { return []ent.Field{ field.String("name"), field.String("user_id"), field.Time("created_at").Default(time.Now), field.Time("updated_at").Default(time.Now), } } // Edges of the Document. func (Document) Edges() []ent.Edge { return nil } func (Document) Indexes() []ent.Index { return []ent.Index{ index.Fields("name", "user_id"), } }