Skip to content

Commit

Permalink
pkp#6724 Make large upgrade installations more reliable (pkp#6724 (co…
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Jun 17, 2021
1 parent b20eb38 commit 833ec01
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions classes/migration/upgrade/PKPv3_3_0UpgradeMigration.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,12 @@ private function _migrateSubmissionFiles() {
}
}

// Delete the rows for old revisions
Capsule::table('submission_files')
->whereIn('new_file_id', $newFileIdsToDelete)
->delete();
// Delete the rows for old revisions (chunked for performance)
foreach (array_chunk($newFileIdsToDelete, 100) as $chunkFileIds) {
Capsule::table('submission_files')
->whereIn('new_file_id', $chunkFileIds)
->delete();
}

// Remove all review round files that point to file ids
// that don't exist, so that the foreign key can be set
Expand Down

0 comments on commit 833ec01

Please sign in to comment.