diff options
author | Robin Appelman <robin@icewind.nl> | 2025-04-02 14:52:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-02 14:52:18 +0200 |
commit | f7d5edfb5f403bc93345fcf4d24b51b015661bd6 (patch) | |
tree | fef1a9e48bdaace28bcf3f417e98ad15b0bfcfa3 | |
parent | f3761c5bd60e18b213cce9d85ea65a081b702cd1 (diff) | |
parent | fc2cda12b5af11037dcb5b54df14336d796c385b (diff) | |
download | nextcloud-server-f7d5edfb5f403bc93345fcf4d24b51b015661bd6.tar.gz nextcloud-server-f7d5edfb5f403bc93345fcf4d24b51b015661bd6.zip |
Merge pull request #51866 from nextcloud/migrations-to-execute-filter-sort
fix: use proper migration sorting when checking if a migration needs to be executed
-rw-r--r-- | lib/private/DB/MigrationService.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 0b59509eaab..2f4c8131d9f 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -199,9 +199,9 @@ class MigrationService { if ($versionA !== $versionB) { return ($versionA < $versionB) ? -1 : 1; } - return ($matchA[2] < $matchB[2]) ? -1 : 1; + return strnatcmp($matchA[2], $matchB[2]); } - return (basename($a) < basename($b)) ? -1 : 1; + return strnatcmp(basename($a), basename($b)); } /** @@ -250,7 +250,7 @@ class MigrationService { $toBeExecuted = []; foreach ($availableMigrations as $v) { - if ($to !== 'latest' && $v > $to) { + if ($to !== 'latest' && ($this->sortMigrations($v, $to) > 0)) { continue; } if ($this->shallBeExecuted($v, $knownMigrations)) { |