diff --git a/examples/entcpkg/ent/template/entinit.tmpl b/examples/entcpkg/ent/template/entinit.tmpl new file mode 100644 index 000000000..c869e63c3 --- /dev/null +++ b/examples/entcpkg/ent/template/entinit.tmpl @@ -0,0 +1,25 @@ +package schema + +import ( + "entgo.io/ent" + "entgo.io/ent/schema/mixin" +) + +// {{ . }} holds the schema definition for the {{ . }} entity. +type {{ . }} struct { + ent.Schema +} + +// Mixins of the {{ . }}. +func ({{ . }}) Mixins() []ent.Mixin { + return []ent.Mixin{ + mixin.Time{}, + } +} + +// Fields of the {{ . }}. +func ({{ . }}) Fields() []ent.Field { + return []ent.Field{ + // Fields go here. + } +}