Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Major createMigrationTable() performance improvement #75

Closed
wants to merge 2 commits into from

2 participants

@dt-stasis

In the createMigrationTable() method in Configuration, the schema is re-created every time the method is called if the migration table already exists.

We were trying to run a fairly large set of migrations across multiple databases and this method is called many times, resulting in lots of createSchema() requests which really slows the migrations down.

Now it's only ever called once per database inside this method greatly improving performance.

@dt-stasis dt-stasis Fix performance issues with the createMigrationTable() method in Conf…
…iguration - the schema would be rebuilt on every request if the migration table already exists.
48f0ebd
...trine/DBAL/Migrations/Configuration/Configuration.php
@@ -477,7 +477,11 @@ public function createMigrationTable()
return true;
}
- return false;
+ else {
@stof Collaborator
stof added a note

no need to use else here as the if returns (exactly as it was done previously)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@stof
Collaborator

Thank you @dtrethewey.

@stof stof referenced this pull request from a commit
@stof stof minor #75 Major createMigrationTable() performance improvement (dtret…
…hewey)

This PR was squashed before being merged into the 1.0.x-dev branch (closes #75).

Discussion
----------

Major createMigrationTable() performance improvement

In the createMigrationTable() method in Configuration, the schema is re-created every time the method is called if the migration table already exists.

We were trying to run a fairly large set of migrations across multiple databases and this method is called many times, resulting in lots of createSchema() requests which really slows the migrations down.

Now it's only ever called once per database inside this method greatly improving performance.

Commits
-------

7ca271b Major createMigrationTable() performance improvement
1a9dffa
@stof stof closed this pull request from a commit
@stof stof minor #75 Major createMigrationTable() performance improvement (dtret…
…hewey)

This PR was squashed before being merged into the 1.0.x-dev branch (closes #75).

Discussion
----------

Major createMigrationTable() performance improvement

In the createMigrationTable() method in Configuration, the schema is re-created every time the method is called if the migration table already exists.

We were trying to run a fairly large set of migrations across multiple databases and this method is called many times, resulting in lots of createSchema() requests which really slows the migrations down.

Now it's only ever called once per database inside this method greatly improving performance.

Commits
-------

7ca271b Major createMigrationTable() performance improvement
1a9dffa
@stof stof closed this in 1a9dffa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 7, 2012
  1. @dt-stasis

    Fix performance issues with the createMigrationTable() method in Conf…

    dt-stasis authored
    …iguration - the schema would be rebuilt on every request if the migration table already exists.
  2. @dt-stasis

    Remove an unnecessary else.

    dt-stasis authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/Doctrine/DBAL/Migrations/Configuration/Configuration.php
View
3  lib/Doctrine/DBAL/Migrations/Configuration/Configuration.php
@@ -477,6 +477,9 @@ public function createMigrationTable()
return true;
}
+
+ $this->migrationTableCreated = true;
+
return false;
}
Something went wrong with that request. Please try again.