35 lines
560 B
Go
35 lines
560 B
Go
package schema
|
|
|
|
import (
|
|
ersteller_ent "ersteller-lib/schema/ent"
|
|
google "ersteller-lib/starter/google"
|
|
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/edge"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
type GoogleAuth struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (GoogleAuth) Mixin() []ent.Mixin {
|
|
return []ent.Mixin{
|
|
ersteller_ent.TimeMixin{},
|
|
}
|
|
}
|
|
|
|
func (GoogleAuth) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.JSON("credentials", google.Credentials{}),
|
|
}
|
|
}
|
|
|
|
func (GoogleAuth) Edges() []ent.Edge {
|
|
return []ent.Edge{
|
|
edge.To("user", User.Type).
|
|
Unique().
|
|
Required(),
|
|
}
|
|
}
|