Skip to content

Commit

Permalink
fix: do not run empty queries
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Feb 17, 2021
1 parent 50745d4 commit 286edc9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions popx/test_migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ func NewTestMigrator(t *testing.T, c *pop.Connection, migrationPath, testDataPat
// FIXME https://github.com/gobuffalo/pop/issues/567
for _, statement := range strings.Split(string(data), ";\n") {
t.Logf("Executing %s query from %s: %s", c.Dialect.Name(), fileName, statement)
if strings.TrimSpace(statement) == "" {
t.Logf("Skipping %s query from %s because empty: \"%s\"", c.Dialect.Name(), fileName, statement)
continue
}
if _, err := tx.Exec(statement); err != nil {
t.Logf("Unable to execute %s: %s", mf.Version, err)
return errors.WithStack(err)
Expand Down

0 comments on commit 286edc9

Please sign in to comment.