Skip to content

Commit

Permalink
Merge pull request #47640 from nextcloud/fix/migrator-replica
Browse files Browse the repository at this point in the history
fix: Run migration sql as statement so that the primary db node is used
  • Loading branch information
juliushaertl authored Sep 2, 2024
2 parents 3973a8f + c3fa25a commit 7f0d0cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/DB/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ protected function applySchema(Schema $targetSchema, ?Connection $connection = n
$step = 0;
foreach ($sqls as $sql) {
$this->emit($sql, $step++, count($sqls));
$connection->executeQuery($sql);
$connection->executeStatement($sql);
}
if (!$connection->getDatabasePlatform() instanceof MySQLPlatform) {
$connection->commit();
Expand Down

0 comments on commit 7f0d0cf

Please sign in to comment.