Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-09-11 12:14:33 +0300
committerJoas Schilling <coding@schilljs.com>2017-09-11 12:14:33 +0300
commite88a4a0b3d5ec7977458eb8190d5100222ae27ef (patch)
tree63e272f5399a6df4cbd0e4bbfbfd1280e555b842
parent6fd01c39936094ec3cb634a52a4cfd7ba40ab28c (diff)
Fix Nextcloud 12 compatibility
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/private/Repair/Owncloud/SaveAccountsTableData.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/Repair/Owncloud/SaveAccountsTableData.php b/lib/private/Repair/Owncloud/SaveAccountsTableData.php
index c9e67356fb9..909cb3be729 100644
--- a/lib/private/Repair/Owncloud/SaveAccountsTableData.php
+++ b/lib/private/Repair/Owncloud/SaveAccountsTableData.php
@@ -23,6 +23,8 @@
namespace OC\Repair\Owncloud;
+use OC\DB\Connection;
+use OC\DB\MDB2SchemaManager;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IConfig;
use OCP\IDBConnection;
@@ -38,7 +40,7 @@ class SaveAccountsTableData implements IRepairStep {
const BATCH_SIZE = 75;
- /** @var IDBConnection */
+ /** @var IDBConnection|Connection */
protected $db;
/** @var IConfig */
@@ -84,7 +86,10 @@ class SaveAccountsTableData implements IRepairStep {
* @return bool
*/
protected function shouldRun() {
- $schema = $this->db->createSchema();
+ // This is the equivalent of the new migration code that is used in 13+
+ $filterExpression = '/^' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/';
+ $this->db->getConfiguration()->setFilterSchemaAssetsExpression($filterExpression);
+ $schema = $this->db->getSchemaManager()->createSchema();
$tableName = $this->config->getSystemValue('dbtableprefix', 'oc_') . 'accounts';
if (!$schema->hasTable($tableName)) {