Affects Version/s: 1.2.2
Fix Version/s: None
in function: Doctrine_Migration_Builder::generateMigrationClass() the generated migration class is included (require_once) after creation. A loadMigrationClass call is made following [line 513] as:
I propose this should change to include the optional "$path" argument to Doctrine_Migration::loadMigrationClass() as:
Since the $path variable is available for the loadMigrationClass it should be included. More importantly NOT including $path breaks the certains behaviors. This occurs as a side effect in symfony for instance when creating a new task that chains:
The reason for the problem is because the generate-migrations-diff properly creates the version class and file and then has a require_once that pulls the class into scope. doctrine:migrate then runs Doctrine_Migration::loadMigrationClassesFromDirectory() to find all the migration classes. The task does NOT see the newly created migration class because it is not associated with the directory dirname($path) pointed out above. The function thoroughly scans the migration class directory with require_once and array_diff's to find new classes. But the new migrations class is already within declaration scope so is missed. Thus the doctrine:migrate task always migrates to the version BEFORE the executed doctrine:generate-migration-diff.