mirror of
https://github.com/nextcloud/server.git
synced 2025-05-02 04:50:37 +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) {
|
if ($versionA !== $versionB) {
|
||||||
return ($versionA < $versionB) ? -1 : 1;
|
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 = [];
|
$toBeExecuted = [];
|
||||||
foreach ($availableMigrations as $v) {
|
foreach ($availableMigrations as $v) {
|
||||||
if ($to !== 'latest' && $v > $to) {
|
if ($to !== 'latest' && ($this->sortMigrations($v, $to) > 0)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($this->shallBeExecuted($v, $knownMigrations)) {
|
if ($this->shallBeExecuted($v, $knownMigrations)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue