Getting Phing's dbdeploy task to automatically rollback on delta error

Posted by Gordon on Stack Overflow See other posts from Stack Overflow or by Gordon
Published on 2010-03-16T11:27:28Z Indexed on 2010/03/16 22:41 UTC
Read the original article Hit count: 539

Filed under:
|
|
|

I am using Phing's dbdeploy task to manage my database schema. This is working fine, as long as there is no errors in the queries of my delta files.

However, if there is an error, dbdeploy will just run the delta files up to the query with the error and then abort. This causes me some frustration, because I have to manually rollback the entry in the changelog table then. If I don't, dbdeploy will assume the migration was successful on a subsequent try.

So the question is, is there any way to get dbdeploy use transactions or can you suggest any other way to have phing rollback automatically when an error occurs?

Note: I'm not that proficient with Phing, so if this involves writing a custom task, any example code or a url with further information is highly appreciated. Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about phing