diff options
author | Joas Schilling <coding@schilljs.com> | 2017-06-01 16:56:34 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-07-05 13:01:19 +0200 |
commit | 15eec7b83c6198a124c2720e8ecc988605428f54 (patch) | |
tree | 62f47bb629b621b883efb17c02194972ba20a71f /lib/private/DB/Migrator.php | |
parent | efa52ec1113eeccbd3935a8c96ea23c47ca190ab (diff) | |
download | nextcloud-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/DB/Migrator.php')
-rw-r--r-- | lib/private/DB/Migrator.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/private/DB/Migrator.php b/lib/private/DB/Migrator.php index 1d00d9a1b45..da381ba0284 100644 --- a/lib/private/DB/Migrator.php +++ b/lib/private/DB/Migrator.php @@ -43,14 +43,10 @@ use Symfony\Component\EventDispatcher\GenericEvent; class Migrator { - /** - * @var \Doctrine\DBAL\Connection $connection - */ + /** @var \Doctrine\DBAL\Connection */ protected $connection; - /** - * @var ISecureRandom - */ + /** @var ISecureRandom */ private $random; /** @var IConfig */ @@ -197,6 +193,12 @@ class Migrator { return new Table($newName, $table->getColumns(), $newIndexes, array(), 0, $table->getOptions()); } + public function createSchema() { + $filterExpression = $this->getFilterExpression(); + $this->connection->getConfiguration()->setFilterSchemaAssetsExpression($filterExpression); + return $this->connection->getSchemaManager()->createSchema(); + } + /** * @param Schema $targetSchema * @param \Doctrine\DBAL\Connection $connection @@ -217,8 +219,7 @@ class Migrator { } $filterExpression = $this->getFilterExpression(); - $this->connection->getConfiguration()-> - setFilterSchemaAssetsExpression($filterExpression); + $this->connection->getConfiguration()->setFilterSchemaAssetsExpression($filterExpression); $sourceSchema = $connection->getSchemaManager()->createSchema(); // remove tables we don't know about |