mirror of
https://github.com/kevin-DL/football_info_api.git
synced 2026-01-11 10:04:28 +00:00
33 lines
607 B
Go
33 lines
607 B
Go
package schema
|
|
|
|
import (
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/field"
|
|
"github.com/google/uuid"
|
|
"time"
|
|
)
|
|
|
|
// Profile holds the schema definition for the Profile entity.
|
|
type Profile struct {
|
|
ent.Schema
|
|
}
|
|
|
|
// Fields of the Profile.
|
|
func (Profile) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.UUID("id", uuid.UUID{}).
|
|
Default(uuid.New),
|
|
field.String("display_name"),
|
|
field.UUID("user_id", uuid.UUID{}).Unique(),
|
|
field.Time("created_at").
|
|
Default(time.Now),
|
|
field.Time("updated_at").
|
|
Default(time.Now),
|
|
}
|
|
}
|
|
|
|
// Edges of the Profile.
|
|
func (Profile) Edges() []ent.Edge {
|
|
return nil
|
|
}
|