Improve getDatabaseVersion
& versioning tests
#6597
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Another small piece of the puzzle for improving migrations and getting test coverage.
The code to do with
currentVersion
was left over from before we ever did our first public release of Ghost, every subsequent migration has since setdatabaseVersion
. We no longer support migrating from < 003, so we can safely ignorecurrentVersion
if it still exists in the settings table.PR #6596 (exporter cleanup & tests) made a change so that it's possible to test knex, and introduced a precedent of doing so - something I hadn't figured out when I started adding tests to cover
versioning.js
.This PR brings coverage to 100% & also uses
should-sinon
to make the test assertions slightly neater.refs #6301
currentVersion
was leftover from before the first public release of Ghost!getDatabaseVersion
getDatabaseVersion
getDatabaseVersion
getDatabaseVersion
andsetDatabaseVersion