tags:

views:

380

answers:

1

Hello,

I am trying to build a script to automate the update process for symfony projects. E.g. apply any patches from one revision to another including any possible model updates and new fixtures without re-loading the entire database.

I have completed most of it, but I have been unable to find a way to generate an SQL file containing the INSERT statements that get executed by propel load data when it inserts the fixture.

I know that I could dump the database to get the info, but that's not the point and that wouldn't work in my case because I'd need an empty db that has no other data on it.

So in short, my question is: Is there a way to take a fixture YML and generate the SQL inserts necessary?

I know this could be done by processing the yml and building the logic, but the build process it does it somewhere and there's no reason to write that again..

Any help would be much appreciated.

A: 

Perhaps I did not understand your question correctly, but couldn't you just call the task that loads the fixtures into the db, or alternatively write code that calls sfPropelData::loadData() (I'm assuming Propel here).

$loader = new sfPropelData();
$loader->loadData(sfConfig::get('sf_data_dir').'/fixtures');

Even sfPropelData and its parent sfData do not generate sql code when loading fixtures, but rather do it using the ORM (as can be seen in sfPropelData::loadDataFromArray().

If you explained your problem more, and why this solution isn't enough, I may be able to help.

Hi,Thanks for your comments... My problem is outlined in the question itself:I am trying to build a script to automate the update process for symfony projects. E.g. apply any patches from one revision to another including any possible model updates and new fixtures without re-loading the entire database.Thanks!!
JuanD