This repository has been archived by the owner on Oct 2, 2022. It is now read-only.
Rollback functionality and optionally logging revision activity to the database #53
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wanted to use dbv in combination with our capistrano deployment scripts. For that 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.