Clojure Migratus: “Migration reserved by another instance”

Migratus is a great migration tool for Clojure enterprise projects. Migrations allow you to do and undo changes to a database very quickly. The best use case for Migratus is update of a database for your enterprise project or setting up a new database for a development environment. Setting up the database can be on a production server or your local development environment.

Eventually one of your migrations is going to have an SQL exception. Normally, SQL exceptions aren’t a big deal. You just fix it, and run the migration again. However, Migration gets into an :ignore state and gives you an exception reading …

… and then refuses to run another migration no matter what you do.

The fix is to go into your ‘schema_migrations’ table in your database and remove the row that has an id of -1.

That’s really a simple fix for your favorite Clojure migration tool.


Leave a Reply

Your email address will not be published. Required fields are marked *