flyway-validator v1.2.2
Flyway migration script validator
This is a simple package that will validate a few facts about the flyway migrations cripts in a provided directory as a sanity check.
Usage
Install with
npm install --save-dev @nw/flyway-validator
or
npm install --save-dev @nw/flyway-validator
then just scan any directory containing flyway scripts
npx @nw/flyway-validator path/to/directory
If everything is ok, the process will complete with an exit code of 0, otherwise it will exit with an error and display a (hopefully) helpful message explaining what it thinks is the problem.
It is recommended to add this check to a pre-commit hook or something so that you dont have to think about it.
What is checked
The first file is versioned as
1.0.0
,0.1.0
,0.0.1
The files version numbers are dates are both in the same sequence
The sequence numbers do not skip any version, ie a jump from
1.0.0
to2.3.0
is invalidNo files have beem modified since the last commit
What is not checked
ANYTHING ELSE!
no sql validations, no schema validations, no model or business logic, that is all up to you. This is seatbelt, you still have to drive safely!