Skip to content

Commit 640d0e5

Browse files
authored
revert: removed crdb execute from migrator (#827)
1 parent 3dbd2a0 commit 640d0e5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

popx/migrator.go

+10-5
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,16 @@ import (
1717
"text/tabwriter"
1818
"time"
1919

20+
"github.com/cockroachdb/cockroach-go/v2/crdb"
2021
"github.com/gobuffalo/pop/v6"
21-
22+
"github.com/pkg/errors"
2223
"go.opentelemetry.io/otel"
2324
"go.opentelemetry.io/otel/attribute"
2425
"go.opentelemetry.io/otel/trace"
2526

2627
"github.com/ory/x/cmdx"
27-
"github.com/ory/x/otelx"
28-
2928
"github.com/ory/x/logrusx"
30-
31-
"github.com/pkg/errors"
29+
"github.com/ory/x/otelx"
3230
)
3331

3432
const (
@@ -609,6 +607,13 @@ func (m *Migrator) exec(ctx context.Context, fn func() error) error {
609607
}
610608
}
611609

610+
if m.Connection.Dialect.Name() == "cockroach" {
611+
outer := fn
612+
fn = func() error {
613+
return crdb.Execute(outer)
614+
}
615+
}
616+
612617
if err := fn(); err != nil {
613618
return err
614619
}

0 commit comments

Comments
 (0)