dialect/sql/schema: hello ariga.io/atlas (#2279)

This commit is contained in:
Ariel Mashraki
2022-01-20 17:20:50 +02:00
committed by GitHub
parent 05590433a7
commit 60e03285d0
13 changed files with 1643 additions and 73 deletions

View File

@@ -9,6 +9,8 @@ import (
"fmt"
"log"
"entgo.io/ent/dialect/sql/schema"
"entgo.io/ent/examples/traversal/ent"
"entgo.io/ent/examples/traversal/ent/group"
"entgo.io/ent/examples/traversal/ent/pet"
@@ -25,7 +27,7 @@ func Example_Traversal() {
defer client.Close()
ctx := context.Background()
// Run the auto migration tool.
if err := client.Schema.Create(ctx); err != nil {
if err := client.Schema.Create(ctx, schema.WithAtlas(true)); err != nil {
log.Fatalf("failed creating schema resources: %v", err)
}
if err := Gen(ctx, client); err != nil {