entc/gen: move schema/snapshot template to its feature-flag (#1211)

This commit is contained in:
Ariel Mashraki
2021-01-26 23:13:33 +02:00
committed by GitHub
parent 8876d31317
commit f5158dce55
2 changed files with 6 additions and 7 deletions

View File

@@ -39,6 +39,12 @@ var (
Stage: Experimental,
Default: false,
Description: "Schema snapshot stores a snapshot of ent/schema and auto-solve merge-conflict (issue #852)",
GraphTemplates: []GraphTemplate{
{
Name: "internal/schema",
Format: "internal/schema.go",
},
},
cleanup: func(c *Config) error {
return remove(filepath.Join(c.Target, "internal"), "schema.go")
},

View File

@@ -155,13 +155,6 @@ var (
Name: "runtime/pkg",
Format: "runtime/runtime.go",
},
{
Name: "internal/schema",
Format: "internal/schema.go",
Skip: func(g *Graph) bool {
return !g.featureEnabled(FeatureSnapshot)
},
},
}
// patterns for extending partial-templates (included by other templates).
partialPatterns = [...]string{