[DMIG-36] Iterating over versions is very slow Created: 05/Mar/13 Updated: 22/Dec/13
|Reporter:||Eric Durand-Tremblay||Assignee:||Benjamin Eberlei|
When iterating migration versions, a call to SchemaManager::createSchema() is done for every versions. Four our schema, this call take about 1 second to execute. With already 30 migrations, this begin to be a problem.
The problem is in Migrations\Configuration\Configuration::createMigrationTable() which does not set the migrationTableCreated flag when the table already exists.
|Comment by Jeroen Thora [ 14/Jul/13 ]|
We are experiencing the same problem, especialy when running migrations (plain sql queries) against a remote server. We have currently 4 migrations scripts, the first and second script contains the creation of around 10 tables (incl indexes, fk's, pk's, etc) this goes relativly fast (goes bit slower than running on a local server but that would be an amount of latancy) but when executing the third script (which only include a drop and create of an index) takes more than 60 seconds to execute. All these migration scripts are
After a bit of debugging it looks like the createSchema() function is called every migration but each migration script the database gets more tables and so it will take each migration more time to finish the createSchema() function
The function is called here: https://github.com/doctrine/migrations/blob/master/lib/Doctrine/DBAL/Migrations/Version.php#L243
First of all why is the create schema function needed to be executed and why every migration, because if you use plain sql migrations (auto-generated from mapping/entities) the migrations should just be executed, they don't need to know anything about the current state of the database except of the current migration version. So wouldn't it be a solution to check if the script containts plain sql or the migrations function and if it's just sql execute the migrations without checking the database
|Comment by Jeroen Thora [ 22/Dec/13 ]|
Benjamin Eberlei & Marco Pivetta any idea's/update on this issue?