Browse Source

Set all migrations as added.

jmontoyaa 8 years ago
parent
commit
3a6a2ed5f8
1 changed files with 5 additions and 7 deletions
  1. 5 7
      main/install/install.lib.php

+ 5 - 7
main/install/install.lib.php

@@ -2180,16 +2180,14 @@ function finishInstallation(
     updateDirAndFilesPermissions();
 
     // Set the latest version
-
     $path = api_get_path(SYS_PATH).'app/Migrations/Schema/V111/';
     $finder = new \Symfony\Component\Finder\Finder();
     $files = $finder->files()->in($path);
-    $list = array_reverse((array)$files->files()->sortByName()->getIterator());
-    /** @var SplFileInfo $lastVersion */
-    $lastVersion = current($list);
-    $version = str_replace(['Version',  '.php' ], '', $lastVersion->getFilename());
-    $sql = "INSERT INTO version VALUES ('$version')";
-    Database::query($sql);
+    foreach ($files as $version) {
+        $version = str_replace(['Version',  '.php' ], '', $version->getFilename());
+        $sql = "INSERT INTO version VALUES ('$version')";
+        Database::query($sql);
+    }
 }
 
 /**