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 FindMigrations panic with missing migrations #81

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

bluekeyes
Copy link
Contributor

If a migration was missing and the directory contained only valid migration files, FindMigrations would panic with an index out of range error instead of returning an error indicating a missing migration.

I think this was missed in #65 because the test data included a non-migration file that added an extra element to the foundMigrations slice.

If a migration was missing and the directory contained only valid
migration files, FindMigrations would panic with an index out of range
error instead of returning an error indicating a missing migration.

This was hidden in the tests because the test data included a
non-migration file that added an extra element to the array.
@jackc jackc merged commit 90ddd6f into jackc:master Apr 19, 2023
@jackc
Copy link
Owner

jackc commented Apr 19, 2023

Thanks!

@bluekeyes bluekeyes deleted the fix-find-panic branch April 19, 2023 02:35
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