tags:

views:

42

answers:

1

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  A: 

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.

Skelton
So, create your entities by hand? Is there a reason to rebuild the models with the automated generator?
ryeguy
Too late to edit my comment, but I meant to say "is there a reason *not* to use the automated generator".
ryeguy
Yes, this generates a lot of stuff not needed and we had some problems with it.
Skelton