Initial commit

This commit is contained in:
2023-07-02 15:26:53 +01:00
committed by GitHub
commit 16ca35eb45
42 changed files with 4536 additions and 0 deletions

32
ent/schema/profile.go Normal file
View 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
}