-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why goose is saying "no migrations to run..." #303
Comments
There are a few In hindsight, we should have made explicit log output an opt-in instead of the default. We take breaking-changes very seriously so we cannot address this in the current |
One possibility would be to introduce a new flag, such as Oh, and we'll also want to make output machine-friendly too, so it can be piped into I'm going to close this issue shortly, but please feel free to share your thoughts or opinions. |
@mfridman can this re-examined? I'm building a CLI tool and it would be nice to disable the logging for end users. |
For those who end up here somehow, I have the following that works: func (cDB *CommitDB) _RunGooseMigration() error {
originalOutput := nativeLog.Writer()
if log.DefaultLogger.Level != log.DebugLevel {
nativeLog.SetOutput(io.Discard)
}
log.Debug().Msg("Running goose migration")
goose.SetBaseFS(embedMigrations)
if err := goose.SetDialect("sqlite3"); err != nil {
return err
}
err := goose.Up(cDB.db, "migrations")
if err != nil {
return err
}
nativeLog.SetOutput(originalOutput)
return nil
} |
@michaelangeloio let's continue the conversation in the filed issue, see my #657 (comment) |
I've got a very simple example:
And one migration file
1001_users.sql
in themigrations
folder.I build my
goose
and when I run it I see:Everything seems to be working just fine. But I was wondering what is the second line in the log? Nothing critical, but the line is a bit confusing. I just ran the migration and everything went through, so why goose is saying "no migration to run...".
Or am I missing something?
Thanks.
The text was updated successfully, but these errors were encountered: