Skip to content

Commit

Permalink
fix: return joined err when try to get migrations list (#862)
Browse files Browse the repository at this point in the history
  • Loading branch information
R0masik authored Feb 4, 2025
1 parent 2829d46 commit fa06062
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"database/sql"
"errors"
"fmt"
"go.uber.org/multierr"
"io/fs"
"math"
"path"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit fa06062

Please sign in to comment.