mirror of
https://github.com/nextcloud/server.git
synced 2025-04-24 09:23:42 +00:00
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
This commit is contained in:
commit
f7d5edfb5f
1 changed files with 3 additions and 3 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue