summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-06-07 12:27:16 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-07-05 13:01:19 +0200
commit817783e4c7e93fc7bf3bdb50a014966415e19605 (patch)
tree4584b9273888ab1f1ebbbbd62524670be9ad75db /lib
parentdf6b839b2347531641864dbc408ab445169ffec6 (diff)
downloadnextcloud-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.php8
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;
});