From 286edc9cd8c8bca6a7c3baafd3c3458ac7875082 Mon Sep 17 00:00:00 2001 From: aeneasr <3372410+aeneasr@users.noreply.github.com> Date: Wed, 17 Feb 2021 14:47:13 +0100 Subject: [PATCH] fix: do not run empty queries --- popx/test_migrator.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/popx/test_migrator.go b/popx/test_migrator.go index f5a70a1c..e7d2479d 100644 --- a/popx/test_migrator.go +++ b/popx/test_migrator.go @@ -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)