tags:

views:

4

answers:

1

Hello. :)

This function purports to build doctrine migration classes based upon a diff between old and new schemas.

Well, where is the old schema stored that the system is diff'ing against? I'm in a symfony project and there is only one schema.yml in my configs.

The brunt of my problem, is that there was a problem with my schema that caused a migration to fail (I had a column named "group")... after making the name change in my schema... ensuring migration generates and migration attempts would invariable give errors because prior migration attempts only partially completed.

So, I've been wanting to set everything back to a "pristine" state, as if there had never been a migration, I want the current schema / database taken as if it were version 0, and fresh migration class made.

However, manually resetting my db, and wiping the migration classes out is not working, and the generated diff classes insist on dropping tables which no longer exist.

So, I'm assuming there is a cached file somewhere with old schema data it's comparing against?

Thanks for any help.

A: 

Ah... the answer was here:

http://stackoverflow.com/questions/1855925/extra-changecolumns-in-doctrine-generate-migrations-diff

It isn't diff'ing with a cached schema.yml, it's comparing against your model classes.

So, solution for "resetting" the migration process would be to manually sync your database and model (probably by resetting the schema.yml to the old structure, regenning models, then manually reverting the database), then all back in the new schema elements, and run generate-migrations-diff.

This worked for me.