Skip to content

Commit

Permalink
revert: removed crdb execute from migrator
Browse files Browse the repository at this point in the history
  • Loading branch information
zepatrik committed Nov 28, 2024
1 parent 3dbd2a0 commit d525b61
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions popx/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ import (
"text/tabwriter"
"time"

"github.com/cockroachdb/cockroach-go/v2/crdb"
"github.com/gobuffalo/pop/v6"

"github.com/pkg/errors"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"

"github.com/ory/x/cmdx"
"github.com/ory/x/otelx"

"github.com/ory/x/logrusx"

"github.com/pkg/errors"
"github.com/ory/x/otelx"
)

const (
Expand Down Expand Up @@ -609,6 +607,13 @@ func (m *Migrator) exec(ctx context.Context, fn func() error) error {
}
}

if m.Connection.Dialect.Name() == "cockroach" {
outer := fn
fn = func() error {
return crdb.Execute(outer)
}
}

if err := fn(); err != nil {
return err
}
Expand Down

0 comments on commit d525b61

Please sign in to comment.