mirror of
https://github.com/kevin-DL/football_info_api.git
synced 2026-01-22 06:25:20 +00:00
Initial commit
This commit is contained in:
32
ent/schema/profile.go
Normal file
32
ent/schema/profile.go
Normal file
@@ -0,0 +1,32 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user