Skip to content

Philosophy

Most migration tools allow to define up and down migrations. When something goes wrong while migrating up it then rollbacks to the previous state by applying corresponding down migration.

This library purposefully DOES NOT support this mechanism. You can only go up!

Allowing to specify down migrations gives you a false sense of security that you can always rollback to a known state.

This is most of the time misleading because if your migration failed it means you didn't think of all possible scenarii. At this point your app is in an unknown state. Trying to apply a rollback from this uncertain point will most likely increase the problem.

Instead of relying on this false sense of security you should maximize your ability to react quickly to a problem by once again moving forward by writing a new up migration once the unknown state is understood.

You can achieve this via quality assurances:

  • use Pull Requests and review them
  • write automated tests and run them in a CI
  • automate the whole deploy process of your app

In the case you really want to write down migrations you can still build such system on top of this library. But you'd probably be better off looking for another tool.