journey validate -p "path\to\versions-dir" -d sqlite -c "Data Source=journal.db"
Calling validate on a migration file ensures that:
- All Transaction blocks are properly opened and closed.
- All sections are properly opened and closed.
- Both the
migration
androllback
sections are present in the file.
While this is not a full proof method to protect against database corruption and dataloss due to harmful queries in the migrations, its a first line of defense that ensure that at least the syntax of the queries is not the cause of a problem. By enforcing that all migrations also have a rollback section, some assurance is provided that the database can always be restored to an earlier state.