Skip to content

Commit

Permalink
all: update atlasgo.io to latest (#2376)
Browse files Browse the repository at this point in the history
  • Loading branch information
a8m committed Mar 4, 2022
1 parent 35a098f commit 3aab4d9
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 34 deletions.
2 changes: 1 addition & 1 deletion dialect/sql/schema/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (m *Migrate) Diff(ctx context.Context, tables ...*Table) error {
if err != nil {
return err
}
return migrate.New(nil, m.atlas.dir, m.atlas.fmt).WritePlan(plan)
return migrate.NewPlanner(nil, m.atlas.dir, migrate.WithFormatter(m.atlas.fmt)).WritePlan(plan)
}

func (m *Migrate) create(ctx context.Context, tables ...*Table) error {
Expand Down
6 changes: 3 additions & 3 deletions entc/integration/migrate/entv1/car/car.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 14 additions & 11 deletions entc/integration/migrate/entv1/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions entc/integration/migrate/entv1/schema/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package schema
import (
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/index"
Expand Down Expand Up @@ -72,6 +73,13 @@ type Car struct {
ent.Schema
}

// Annotations of the Car.
func (Car) Annotations() []schema.Annotation {
return []schema.Annotation{
entsql.Annotation{Table: "Car"},
}
}

func (Car) Edges() []ent.Edge {
return []ent.Edge{
edge.From("owner", User.Type).
Expand Down
4 changes: 2 additions & 2 deletions entc/integration/migrate/entv1/user/user.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions entc/integration/migrate/entv2/car/car.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 14 additions & 11 deletions entc/integration/migrate/entv2/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions entc/integration/migrate/entv2/schema/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package schema
import (
"time"

"entgo.io/ent/schema"

"entgo.io/ent"
"entgo.io/ent/dialect"
"entgo.io/ent/dialect/entsql"
Expand Down Expand Up @@ -142,6 +144,13 @@ type Car struct {
ent.Schema
}

// Annotations of the Car.
func (Car) Annotations() []schema.Annotation {
return []schema.Annotation{
entsql.Annotation{Table: "Car"},
}
}

func (Car) Edges() []ent.Edge {
return []ent.Edge{
edge.From("owner", User.Type).
Expand Down
4 changes: 2 additions & 2 deletions entc/integration/migrate/entv2/user/user.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module entgo.io/ent
go 1.17

require (
ariga.io/atlas v0.3.5-0.20220215131223-8043663b4223
ariga.io/atlas v0.3.7-0.20220303204946-787354f533c3
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/go-openapi/inflect v0.19.0
github.com/go-sql-driver/mysql v1.6.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ariga.io/atlas v0.3.5-0.20220215131223-8043663b4223 h1:kthcdfUZLRcoVeZetK8gJ0FGaw2D5zrr3h2nP/TuXCw=
ariga.io/atlas v0.3.5-0.20220215131223-8043663b4223/go.mod h1:XcLUpQX7Cq4qtagEHIleq3MJaBeeJ76BS8doc4gkOJk=
ariga.io/atlas v0.3.7-0.20220303204946-787354f533c3 h1:fjG4oFCQEfGrRi0QoxWcH2OO28CE6VYa6DkIr3yDySU=
ariga.io/atlas v0.3.7-0.20220303204946-787354f533c3/go.mod h1:yWGf4VPiD4SW83+kAqzD624txN9VKoJC+bpVXr2pKJA=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
Expand Down

0 comments on commit 3aab4d9

Please sign in to comment.