Skip to content
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

fix: log reason for version table creation #891

Conversation

lefinal
Copy link

@lefinal lefinal commented Jan 28, 2025

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.

In our case, a PostgreSQL database was backed up and restored. Despite the version table existing, due to a misconfiguration it could not access it and tried to create it again. Logging the reason why we create the table improves the debugging experience and transparency of what goose is actually doing.

@lefinal lefinal force-pushed the fix-log-reason-for-version-table-creation branch from 19606ca to 891486f Compare January 28, 2025 08:39
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.
@lefinal lefinal force-pushed the fix-log-reason-for-version-table-creation branch from 891486f to 4793bec Compare January 28, 2025 08:51
@mfridman
Copy link
Collaborator

Are you using goose as a Go library or the standalone goose binary?

@lefinal
Copy link
Author

lefinal commented Jan 28, 2025

Are you using goose as a Go library or the standalone goose binary?

@mfridman We use goose as Go library for automated migration on startup and are quite happy with it. We only ran into this issue last week and thought this might be helpful in general :)

@mfridman
Copy link
Collaborator

mfridman commented Feb 4, 2025

Thanks for putting up a PR. I think less logging is ideal, so went with the alternative which is to join the errors in this PR:

#862

@lefinal lefinal closed this Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants