pcmt/ent/schema/setup.go
leo 3a2f85f683
All checks were successful
continuous-integration/drone/push Build is passing
feat: add license headers (+spdx id)
2023-05-20 20:15:57 +02:00

36 lines
603 B
Go

// Copyright 2023 wanderer <a_mirre at utb dot cz>
// SPDX-License-Identifier: AGPL-3.0-only
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
}