crowdsec/pkg/database/ent/schema/lock.go

23 lines
414 B
Go
Raw Normal View History

package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
"github.com/crowdsecurity/crowdsec/pkg/types"
)
type Lock struct {
ent.Schema
}
func (Lock) Fields() []ent.Field {
return []ent.Field{
2024-03-12 14:29:59 +00:00
field.String("name").Unique().Immutable().StructTag(`json:"name"`),
field.Time("created_at").Default(types.UtcNow).StructTag(`json:"created_at"`),
}
}
func (Lock) Edges() []ent.Edge {
return nil
}