crowdsec/pkg/database/ent/schema/meta.go
Thibault "bui" Koechlin 28446b6d29
Ent update : 0.7.0 (#692)
* up regenerate new schema

* new ent

* update documentation for min required versions

* update documentation
2021-03-15 18:46:52 +01:00

35 lines
591 B
Go

package schema
import (
"time"
"entgo.io/ent"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
)
// Meta holds the schema definition for the Meta entity.
type Meta struct {
ent.Schema
}
// Fields of the Meta.
func (Meta) Fields() []ent.Field {
return []ent.Field{
field.Time("created_at").
Default(time.Now),
field.Time("updated_at").
Default(time.Now),
field.String("key"),
field.String("value").MaxLen(4095),
}
}
// Edges of the Meta.
func (Meta) Edges() []ent.Edge {
return []ent.Edge{
edge.From("owner", Alert.Type).
Ref("metas").
Unique(),
}
}