diff --git a/down.go b/down.go index c0b47ba87..c58c2144c 100644 --- a/down.go +++ b/down.go @@ -54,11 +54,15 @@ func DownTo(db *sql.DB, dir string, version int64, opts ...OptionsFunc) error { return err } - current, err := migrations.Current(currentVersion) - if err != nil { + if currentVersion == 0 { log.Printf("goose: no migrations to run. current version: %d\n", currentVersion) return nil } + current, err := migrations.Current(currentVersion) + if err != nil { + log.Printf("goose: migration file not found for current version (%d), error: %s\n", currentVersion, err) + return err + } if current.Version <= version { log.Printf("goose: no migrations to run. current version: %d\n", currentVersion)