Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.2.2
-
Fix Version/s: None
-
Component/s: Migrations
-
Labels:None
-
Environment:N/A
Description
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:
$this->migration->loadMigrationClass($className);
I propose this should change to include the optional "$path" argument to Doctrine_Migration::loadMigrationClass() as:
$this->migration->loadMigrationClass($className, $path);
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:
doctrine:generate-migrations-diff
doctrine:migrate
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.
Activity
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DC-767, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)