Skip to content

Commit

Permalink
fix: log reason for version table creation
Browse files Browse the repository at this point in the history
Adds a log entry for when the version table is created, including the reason (original error).
This simplifies debugging of environments where users expect version tables to already exist.
  • Loading branch information
Lennart Altenhof committed Jan 28, 2025
1 parent dc90c17 commit 19606ca
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ 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 {
log.Printf("goose: create version table due to issue: %s", err.Error())
return 0, createVersionTable(ctx, db)
}
// The most recent record for each migration specifies
Expand Down

0 comments on commit 19606ca

Please sign in to comment.