2024-02-14 11:26:42 +00:00
|
|
|
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"`),
|
2024-02-14 11:26:42 +00:00
|
|
|
field.Time("created_at").Default(types.UtcNow).StructTag(`json:"created_at"`),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (Lock) Edges() []ent.Edge {
|
|
|
|
return nil
|
|
|
|
}
|