mirror of https://github.com/pressly/goose.git
fix: return joined err when try to get migrations list (#862)
parent
2829d46672
commit
fa06062cdc
|
@ -5,6 +5,7 @@ import (
|
|||
"database/sql"
|
||||
"errors"
|
||||
"fmt"
|
||||
"go.uber.org/multierr"
|
||||
"io/fs"
|
||||
"math"
|
||||
"path"
|
||||
|
@ -213,7 +214,11 @@ func EnsureDBVersion(db *sql.DB) (int64, error) {
|
|||
func EnsureDBVersionContext(ctx context.Context, db *sql.DB) (int64, error) {
|
||||
dbMigrations, err := store.ListMigrations(ctx, db, TableName())
|
||||
if err != nil {
|
||||
return 0, createVersionTable(ctx, db)
|
||||
createErr := createVersionTable(ctx, db)
|
||||
if createErr != nil {
|
||||
return 0, multierr.Append(err, createErr)
|
||||
}
|
||||
return 0, nil
|
||||
}
|
||||
// The most recent record for each migration specifies
|
||||
// whether it has been applied or rolled back.
|
||||
|
|
Loading…
Reference in New Issue