How to check if there are any unapplied migrations

I would like to prevent production code from starting if it is expecting migrations to have been run that haven’t been run.

I would like to be able to get a list of unapplied migrations (if any) so that I can print out an error with the migration details.

Another use case is to print the migrations that are about to be applied before running them.

Is this possible?

1 Like

You can find undeployed changesets using the “status” command.

3 Likes

Thanks @daryldoak that’s very helpful! For future searchers, a useful Java method for doing this from code is listUnrunChangeSets.