mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 18:50:47 -04:00
Fix Nextcloud 12 compatibility
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
6fd01c3993
commit
e88a4a0b3d
1 changed files with 7 additions and 2 deletions
|
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
namespace OC\Repair\Owncloud;
|
namespace OC\Repair\Owncloud;
|
||||||
|
|
||||||
|
use OC\DB\Connection;
|
||||||
|
use OC\DB\MDB2SchemaManager;
|
||||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||||
use OCP\IConfig;
|
use OCP\IConfig;
|
||||||
use OCP\IDBConnection;
|
use OCP\IDBConnection;
|
||||||
|
|
@ -38,7 +40,7 @@ class SaveAccountsTableData implements IRepairStep {
|
||||||
|
|
||||||
const BATCH_SIZE = 75;
|
const BATCH_SIZE = 75;
|
||||||
|
|
||||||
/** @var IDBConnection */
|
/** @var IDBConnection|Connection */
|
||||||
protected $db;
|
protected $db;
|
||||||
|
|
||||||
/** @var IConfig */
|
/** @var IConfig */
|
||||||
|
|
@ -84,7 +86,10 @@ class SaveAccountsTableData implements IRepairStep {
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function shouldRun() {
|
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';
|
$tableName = $this->config->getSystemValue('dbtableprefix', 'oc_') . 'accounts';
|
||||||
if (!$schema->hasTable($tableName)) {
|
if (!$schema->hasTable($tableName)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue