views:

632

answers:

1

Is it possible have a migration script automatically generate from a table schema in Doctrine?

For example, during heavy development of new features, I will oftern build out my tables first while writing the initial code. I usually don't create a migration to start because the definition of the table may change as the feature is still in its infant stages. Once the feature is ready to commit I will write a migration to generate the table structure for the new feature. Often, there will be several new tables.

Call me lazy but it would be awesome if could have those migrations built automagically.

For example:

doctrine build-migration table_name

Does something exist to accomplish something like this?

+1  A: 

This (or something like it) is present in Doctrine 1.1, you can get a preview version from the doctrine site.

See: http://www.doctrine-project.org/blog/new-to-migrations-in-1-1

Ciaran McNulty
This is great. You have to do the generation from a yaml file but the newer phpmyadmin versions allow you to export a db to yaml. Just need to wait for Doctrine 1.1 to be released now.
D-Rock
D-Rock - in fact Doctrine lets you generate a Yaml from your DB too...
Ciaran McNulty