diff options
author | Joas Schilling <coding@schilljs.com> | 2017-06-07 12:27:16 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-07-05 13:01:19 +0200 |
commit | 817783e4c7e93fc7bf3bdb50a014966415e19605 (patch) | |
tree | 4584b9273888ab1f1ebbbbd62524670be9ad75db /lib | |
parent | df6b839b2347531641864dbc408ab445169ffec6 (diff) | |
download | nextcloud-server-817783e4c7e93fc7bf3bdb50a014966415e19605.tar.gz nextcloud-server-817783e4c7e93fc7bf3bdb50a014966415e19605.zip |
Add a version to migrations, so parallel legacy branches can also have migrations
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/DB/MigrationService.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 3cfd36b89b1..9c37a4ffa71 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -170,6 +170,14 @@ class MigrationService { $files = array_keys(iterator_to_array($iterator)); uasort($files, function ($a, $b) { + preg_match('/^Version(\d+)Date(\d+)\\.php$/', basename($a), $matchA); + preg_match('/^Version(\d+)Date(\d+)\\.php$/', basename($b), $matchB); + if (!empty($matchA) && !empty($matchB)) { + if ($matchA[1] !== $matchB[1]) { + return ($matchA[1] < $matchB[1]) ? -1 : 1; + } + return ($matchA[2] < $matchB[2]) ? -1 : 1; + } return (basename($a) < basename($b)) ? -1 : 1; }); |