We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6fb8f98 commit 43c593fCopy full SHA for 43c593f
adapter/migrator.go
@@ -49,9 +49,12 @@ func (m *Migrator) RunMigration(mg *Migration) error {
49
sql := string(f)
50
51
for _, line := range strings.Split(sql, "\n") {
52
- _, err = m.Adapter.ExecContext(context.Background(), line)
53
- if err != nil {
54
- return fmt.Errorf("migration error: %v", err)
+ line = strings.TrimSpace(line)
+ if line != "" {
+ _, err = m.Adapter.ExecContext(context.Background(), line)
55
+ if err != nil {
56
+ return fmt.Errorf("migration error: %v", err)
57
+ }
58
}
59
60
0 commit comments