Coding an ORM based software having multiple development git branches ain’t trivial.

By definition, your database scheme evolves with your model code and you quickly end up with errors when you apply a database migration in one branch then checkout another one : database and code get unsynchronized and … you’re doomed

You can go back to normal by applying reverse migrations but you don’t want that as it’s time consuming and introduces unnecessary complications in your daily workflow.

What else then?

For practical purpose we want to use the same database no matter the branch, so that we always have same testing data available. Having one database per branch defeats that point and does not scale well with number of branches (creating a branch in git is cheap as opposed to restoring a database).

The trick consists to use stellar , this tool keeps snapshots of the database in the RDBMS, and works as follow :