pcmt/ent/schema/setup.go
leo b1ab686493
All checks were successful
continuous-integration/drone/push Build is passing
go: add db module for preps/checks
2023-05-05 22:52:59 +02:00

33 lines
509 B
Go

package schema
import (
"time"
"entgo.io/ent"
"entgo.io/ent/schema/field"
"github.com/google/uuid"
)
// Setup holds the schema definition for the Setup entity.
type Setup struct {
ent.Schema
}
// Fields of the Setup.
func (Setup) Fields() []ent.Field {
return []ent.Field{
field.UUID("id", uuid.UUID{}).
Default(uuid.New).
Unique().
Immutable(),
field.Time("set_up_at").
Default(time.Now).
Immutable(),
}
}
// Edges of the Setup.
func (Setup) Edges() []ent.Edge {
return nil
}