go get github.com/ugurkorkmaz/mixin
package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
"github.com/ugurkorkmaz/mixin"
)
// User holds the schema definition for the User entity.
type User struct {
ent.Schema
}
// Mixin of the User.
func (User) Mixin() []ent.Mixin {
return []ent.Mixin{
mixin.Id{},
}
}
// Fields of the User.
func (User) Fields() []ent.Field {
return []ent.Field{
field.String("name"),
}
}
package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
"github.com/ugurkorkmaz/mixin"
)
// User holds the schema definition for the User entity.
type User struct {
ent.Schema
}
// Mixin of the User.
func (User) Mixin() []ent.Mixin {
return []ent.Mixin{
mixin.CreatedAt{},
}
}
// Fields of the User.
func (User) Fields() []ent.Field {
return []ent.Field{
field.String("name"),
}
}
package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
"github.com/ugurkorkmaz/mixin"
)
// User holds the schema definition for the User entity.
type User struct {
ent.Schema
}
// Mixin of the User.
func (User) Mixin() []ent.Mixin {
return []ent.Mixin{
mixin.DeletedAt{},
}
}
// Fields of the User.
func (User) Fields() []ent.Field {
return []ent.Field{
field.String("name"),
}
}
package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
"github.com/ugurkorkmaz/mixin"
)
// User holds the schema definition for the User entity.
type User struct {
ent.Schema
}
// Mixin of the User.
func (User) Mixin() []ent.Mixin {
return []ent.Mixin{
mixin.UpdatedAt{},
}
}
// Fields of the User.
func (User) Fields() []ent.Field {
return []ent.Field{
field.String("name"),
}
}
go mod tidy