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 failed migration filename #2910

Merged
merged 2 commits into from Nov 16, 2018
Merged

Conversation

@nigelzor
Copy link
Contributor

@nigelzor nigelzor commented Nov 16, 2018

re: #2602

Failing migrations report that the latest migration file failed, rather than the migration file that was being applied when the error occurred.

The existing test suite shows this behaviour:

migration file "20150109095253_migration_after_invalid.js" failed
migration failed with error: SELECT foo FROM unknown_table - SQLITE_ERROR: no such table: unknown_table

After:

migration file "20150109002832_invalid_migration.js" failed
migration failed with error: SELECT foo FROM unknown_table - SQLITE_ERROR: no such table: unknown_table
nigelzor added 2 commits Nov 15, 2018
Migrator._activeMigration needs to be set twice: once when loading the
migration, and again when running it.
@kibertoad
Copy link
Collaborator

@kibertoad kibertoad commented Nov 16, 2018

@nigelzor This is fantastic, thank you so much!

@kibertoad kibertoad merged commit 833829a into knex:master Nov 16, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.003%) to 84.773%
Details
mwilliammyers added a commit to voxjar/knex that referenced this pull request Dec 12, 2018
* Fix migration test assertions

* Report failing migration instead of latest migration

Migrator._activeMigration needs to be set twice: once when loading the
migration, and again when running it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants