Skip to content

Commit

Permalink
Merge pull request #1152 from lochmueller/1146-performance
Browse files Browse the repository at this point in the history
Fix #1146 - Increase performance in DB compare
  • Loading branch information
mbrodala committed Sep 27, 2023
2 parents 466ead4 + c5ddc5f commit d6b97fb
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Classes/Console/Service/Database/SchemaService.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,23 @@ public function __construct(SchemaUpdateInterface $schemaUpdate)
*/
public function updateSchema(array $schemaUpdateTypes, $dryRun = false)
{
$updateStatements = [
SchemaUpdateType::GROUP_SAFE => $this->schemaUpdate->getSafeUpdates(),
SchemaUpdateType::GROUP_DESTRUCTIVE => $this->schemaUpdate->getDestructiveUpdates(),
$select = [
SchemaUpdateType::GROUP_SAFE => false,
SchemaUpdateType::GROUP_DESTRUCTIVE => false,
];
foreach ($schemaUpdateTypes as $schemaUpdateType) {
foreach ($schemaUpdateType->getStatementTypes() as $statementGroup) {
$select[$statementGroup] = true;
}
}

$updateStatements = [];
if ($select[SchemaUpdateType::GROUP_SAFE]) {
$updateStatements[SchemaUpdateType::GROUP_SAFE] = $this->schemaUpdate->getSafeUpdates();
}
if ($select[SchemaUpdateType::GROUP_DESTRUCTIVE]) {
$updateStatements[SchemaUpdateType::GROUP_DESTRUCTIVE] = $this->schemaUpdate->getDestructiveUpdates();
}

$updateResult = new SchemaUpdateResult();

Expand Down

0 comments on commit d6b97fb

Please sign in to comment.