Add ent schema to starter

This commit is contained in:
Achim Rohn
2025-09-14 16:34:52 +02:00
parent 92488618a9
commit fae6653f94
25 changed files with 3982 additions and 7 deletions
+28
View File
@@ -0,0 +1,28 @@
package schema
import (
"ersteller-lib/schema/ent"
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
// User holds the schema definition for the User entity.
type User struct {
ent.Schema
}
func (User) Mixin() []ent.Mixin {
return []ent.Mixin{
ersteller_ent.TimeMixin{},
}
}
// Fields of the User.
func (User) Fields() []ent.Field {
return []ent.Field{
field.String("email").
Default("unknown@localhost"),
field.String("password").Default(""),
}
}