Feature (new)

propper database migrate up/down functions like ruby on rails


Nov 10, 2006
Nov 10, 2006 / pixtur
Jan 5, 2009 / phsouzacruz

Attached files

No files uploaded
Instead of a list of SQL-Queries to update the database, we should write pairs of functions to do and revert the changes to the database. Ruby on Rails calls this 'migrate up' and 'migrate down'. It works very well.

During development downgrading can become very important and write both functions should be not such a big deal:

$fn= array();
if($version < "v0.x.x") {
 $fn[]= function() {

$changes= array(
new DbChangeSet (

 #... should be completed



No Comments