crowdsec/pkg/database/ent/schema/bouncer.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

38 lines
779 B
Go

package schema
import (
"time"
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
// Bouncer holds the schema definition for the Bouncer entity.
type Bouncer struct {
ent.Schema
}
// Fields of the Bouncer.
func (Bouncer) Fields() []ent.Field {
return []ent.Field{
field.Time("created_at").
Default(time.Now),
field.Time("updated_at").
Default(time.Now),
field.String("name").Unique(),
field.String("api_key"), // hash of api_key
field.Bool("revoked"),
field.String("ip_address").Default("").Optional(),
field.String("type").Optional(),
field.String("version").Optional(),
field.Time("until").Default(time.Now).Optional(),
field.Time("last_pull").
Default(time.Now),
}
}
// Edges of the Bouncer.
func (Bouncer) Edges() []ent.Edge {
return nil
}