This commit is contained in:
Kegan Dougal 2020-10-15 17:09:52 +01:00
parent 5a63ec5895
commit 5b03d9100f
2 changed files with 7 additions and 2 deletions

View file

@ -39,6 +39,7 @@ var (
}
)
// nolint: gocyclo
func main() {
err := flags.Parse(os.Args[1:])
if err != nil {

View file

@ -49,9 +49,13 @@ func (m *Migrations) RunDeltas(db *sql.DB, props *config.DatabaseOptions) error
return fmt.Errorf("RunDeltas: Failed to collect migrations: %w", err)
}
if props.ConnectionString.IsPostgres() {
goose.SetDialect("postgres")
if err = goose.SetDialect("postgres"); err != nil {
return err
}
} else if props.ConnectionString.IsSQLite() {
goose.SetDialect("sqlite3")
if err = goose.SetDialect("sqlite3"); err != nil {
return err
}
} else {
return fmt.Errorf("Unknown connection string: %s", props.ConnectionString)
}