summaryrefslogtreecommitdiffstats
path: root/lib/private/Setup/AbstractDatabase.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-06-01 16:56:34 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-07-05 13:01:19 +0200
commit15eec7b83c6198a124c2720e8ecc988605428f54 (patch)
tree62f47bb629b621b883efb17c02194972ba20a71f /lib/private/Setup/AbstractDatabase.php
parentefa52ec1113eeccbd3935a8c96ea23c47ca190ab (diff)
downloadnextcloud-server-15eec7b83c6198a124c2720e8ecc988605428f54.tar.gz
nextcloud-server-15eec7b83c6198a124c2720e8ecc988605428f54.zip
Start migrations
Fixme: - Install and update of apps - No revert on live systems (debug only) - Service adjustment to our interface - Loading via autoloader Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Setup/AbstractDatabase.php')
-rw-r--r--lib/private/Setup/AbstractDatabase.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/Setup/AbstractDatabase.php b/lib/private/Setup/AbstractDatabase.php
index d5c34291e60..2fbec326a5d 100644
--- a/lib/private/Setup/AbstractDatabase.php
+++ b/lib/private/Setup/AbstractDatabase.php
@@ -27,6 +27,7 @@
namespace OC\Setup;
use OC\DB\ConnectionFactory;
+use OC\DB\MigrationService;
use OC\SystemConfig;
use OCP\IL10N;
use OCP\ILogger;
@@ -143,4 +144,12 @@ abstract class AbstractDatabase {
* @param string $userName
*/
abstract public function setupDatabase($userName);
+
+ public function runMigrations() {
+ if (!is_dir(\OC::$SERVERROOT."/core/Migrations")) {
+ return;
+ }
+ $ms = new MigrationService('core', \OC::$server->getDatabaseConnection());
+ $ms->migrate();
+ }
}