victorstanciu/dbv — pull request #53 by jellemunk (2013-08-01 06:15:15+00:00)
Title: Rollback functionality and optionally logging revision activity to the database

I really liked your db version control systeem but I wanted to use it in combination with our capistrano deployment scripts. I needed some features which were already discussed on the issues page so I implemented them.
First I needed simple rollback functionality were you just write the rollback script manually and place it in a folder 'rollback' within the revision.
Then I needed a log, so I could keep track which commit is associated with which revision number.
Third a needed a command line interface so I can call this script from my capistrano scripts.

The idea is that whenever I do a deployment through capistrano I do
$ php pathtodbv/cl.php last [current commit]
This will run all available revisions and logs the number of the last revision together with the commit to the db. Whenever I want to do a rollback I call.
$ php pathtodbv/cl.php commit [commit to rollback to]
It then looks up the revision associated with that commit and rolls back to it.

Changes to the interface are not great. But if you would like to integrate these functionalities I'm happy to help out and improve that.