diff options
author | Robin Appelman <robin@icewind.nl> | 2025-04-02 14:29:08 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2025-04-02 12:52:40 +0000 |
commit | 2708a2b622e8722f41d4b5fd2ad30c4012321611 (patch) | |
tree | 1de052b804a0ab55cb7a5c41d4e2b264280a3996 /lib | |
parent | 6104b434f60d0b05be11b8de22d37c613423a05b (diff) | |
download | nextcloud-server-2708a2b622e8722f41d4b5fd2ad30c4012321611.tar.gz nextcloud-server-2708a2b622e8722f41d4b5fd2ad30c4012321611.zip |
fix: use proper migration sorting when checking if a migration needs to be executedbackport/51866/stable30
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-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 5ee4cb9570d..8d65f836789 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)) { |