Running Migrations
The API
There is exactly one entry point:
List applied = new Migrator(connection, "db").migrate();
migrate() verifies the checksums of everything already applied, then applies each pending migration in order and returns the versions it applied — in the order they were applied, empty when the database is already up to date. It throws the checked MigrationException when anything goes wrong, so failures can’t be ignored by accident.
There’s no dry-run mode and no separate “info” or “validate” call. If you want to know what a run would do, run it: it’s idempotent, and the return value tells you what happened.
评论
?
参与讨论