aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-04-02 14:29:08 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-04-02 12:52:52 +0000
commit28c63750f9e0f4a00dc928d27a63f3e78751b36f (patch)
tree2cc2101eb56efbb691d818c00a2729d9709b40f5
parent69a88210c46875f23337b97ee9abe3e749d9542e (diff)
downloadnextcloud-server-backport/51866/stable31.tar.gz
nextcloud-server-backport/51866/stable31.zip
fix: use proper migration sorting when checking if a migration needs to be executedbackport/51866/stable31
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--lib/private/DB/MigrationService.php6
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)) {