diff options
Diffstat (limited to 'lib/private/Setup/AbstractDatabase.php')
-rw-r--r-- | lib/private/Setup/AbstractDatabase.php | 9 |
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(); + } } |