1
votes

The decision I'm trying to make is where I want to do schema changes. I need a schema update to happen in the database, in the model definition, and I'd also like to generate a doctrine migration for that change too. I would really prefer to only have to define schema changes in one place, not three.

Right now I'm thinking of writing all schema changes only as doctrine migrations. I then have a command line tool that runs all pending migrations and does a database->model sync. Is this reliable enough to work? I'm using postgresql if it matters.

1
Are you are using Zend_Framework too? If so, take a look at ZFDoctrine - takeshin
@takeshin no, this is a standalone backend application. - ryeguy
@takeshin that will not work with doctrine 2 - tom
@Skelton The OP is tagged doctrine, not doctrine2. I'm sure there will be similar component for Doctrine 2 soon (there is already proposal). ZF2 is coming too. Both ZF2 and Doctrine 2 are still in beta by now. - takeshin

1 Answers

1
votes

The standard flow is to generate an empty doctrine migrations, add the schema changes run the migrations and create your entities. So you'll only need to modify it at 2 places.

This works perfectly with my set-up. Never had any problems with it if you check your down statement at least.