mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
fix(db)!: Fix casing of doctrine's SQLitePlatform
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
c2394958c0
commit
015a3e85fe
9 changed files with 18 additions and 18 deletions
|
|
@ -11,7 +11,7 @@ namespace OCA\Settings\SetupChecks;
|
|||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\OraclePlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Platforms\SQLitePlatform;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\IL10N;
|
||||
use OCP\IURLGenerator;
|
||||
|
|
@ -103,7 +103,7 @@ class SupportedDatabase implements ISetupCheck {
|
|||
}
|
||||
} elseif ($databasePlatform instanceof OraclePlatform) {
|
||||
$version = 'Oracle';
|
||||
} elseif ($databasePlatform instanceof SqlitePlatform) {
|
||||
} elseif ($databasePlatform instanceof SQLitePlatform) {
|
||||
return SetupResult::warning(
|
||||
$this->l10n->t('SQLite is currently being used as the backend database. For larger installations we recommend that you switch to a different database backend. This is particularly recommended when using the desktop client for file synchronisation. To migrate to another database use the command line tool: "occ db:convert-type".'),
|
||||
$this->urlGenerator->linkToDocs('admin-db-conversion')
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ declare(strict_types=1);
|
|||
*/
|
||||
namespace OCA\Settings\Tests;
|
||||
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Platforms\SQLitePlatform;
|
||||
use OCA\Settings\SetupChecks\SupportedDatabase;
|
||||
use OCP\IDBConnection;
|
||||
use OCP\IL10N;
|
||||
|
|
@ -42,7 +42,7 @@ class SupportedDatabaseTest extends TestCase {
|
|||
|
||||
public function testPass(): void {
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
if ($platform instanceof SqlitePlatform) {
|
||||
if ($platform instanceof SQLitePlatform) {
|
||||
/** SQlite always gets a warning */
|
||||
$this->assertEquals(SetupResult::WARNING, $this->check->run()->getSeverity());
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
namespace OCA\User_LDAP\Mapping;
|
||||
|
||||
use Doctrine\DBAL\Exception;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Platforms\SQLitePlatform;
|
||||
use OCP\DB\IPreparedStatement;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
|
@ -216,7 +216,7 @@ abstract class AbstractMapping {
|
|||
public function getListOfIdsByDn(array $fdns): array {
|
||||
$totalDBParamLimit = 65000;
|
||||
$sliceSize = 1000;
|
||||
$maxSlices = $this->dbc->getDatabasePlatform() instanceof SqlitePlatform ? 9 : $totalDBParamLimit / $sliceSize;
|
||||
$maxSlices = $this->dbc->getDatabasePlatform() instanceof SQLitePlatform ? 9 : $totalDBParamLimit / $sliceSize;
|
||||
$results = [];
|
||||
|
||||
$slice = 1;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
namespace OC\Core\Command\Db;
|
||||
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Platforms\SQLitePlatform;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
use OC\DB\Connection;
|
||||
use OC\DB\SchemaWrapper;
|
||||
|
|
@ -53,7 +53,7 @@ class ConvertFilecacheBigInt extends Command {
|
|||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$schema = new SchemaWrapper($this->connection);
|
||||
$isSqlite = $this->connection->getDatabasePlatform() instanceof SqlitePlatform;
|
||||
$isSqlite = $this->connection->getDatabasePlatform() instanceof SQLitePlatform;
|
||||
$updates = [];
|
||||
|
||||
$tables = static::getColumnsByTable();
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use Doctrine\DBAL\Exception;
|
|||
use Doctrine\DBAL\Exception\ConnectionLost;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\OraclePlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Platforms\SQLitePlatform;
|
||||
use Doctrine\DBAL\Result;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\DBAL\Statement;
|
||||
|
|
@ -671,7 +671,7 @@ class Connection extends PrimaryReadReplicaConnection {
|
|||
$platform = $this->getDatabasePlatform();
|
||||
$config = \OC::$server->getConfig();
|
||||
$dispatcher = Server::get(\OCP\EventDispatcher\IEventDispatcher::class);
|
||||
if ($platform instanceof SqlitePlatform) {
|
||||
if ($platform instanceof SQLitePlatform) {
|
||||
return new SQLiteMigrator($this, $config, $dispatcher);
|
||||
} elseif ($platform instanceof OraclePlatform) {
|
||||
return new OracleMigrator($this, $config, $dispatcher);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
|
|||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\OraclePlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Platforms\SQLitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use OC\DB\Exceptions\DbalException;
|
||||
use OCP\DB\IPreparedStatement;
|
||||
|
|
@ -238,7 +238,7 @@ class ConnectionAdapter implements IDBConnection {
|
|||
return IDBConnection::PLATFORM_ORACLE;
|
||||
} elseif ($platform instanceof PostgreSQLPlatform) {
|
||||
return IDBConnection::PLATFORM_POSTGRES;
|
||||
} elseif ($platform instanceof SqlitePlatform) {
|
||||
} elseif ($platform instanceof SQLitePlatform) {
|
||||
return IDBConnection::PLATFORM_SQLITE;
|
||||
} else {
|
||||
throw new \Exception('Database ' . $platform::class . ' not supported');
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@
|
|||
*/
|
||||
namespace OC\DB;
|
||||
|
||||
class OCSqlitePlatform extends \Doctrine\DBAL\Platforms\SqlitePlatform {
|
||||
class OCSqlitePlatform extends \Doctrine\DBAL\Platforms\SQLitePlatform {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace OC\DB\QueryBuilder;
|
|||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\OraclePlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Platforms\SQLitePlatform;
|
||||
use Doctrine\DBAL\Query\QueryException;
|
||||
use OC\DB\ConnectionAdapter;
|
||||
use OC\DB\QueryBuilder\ExpressionBuilder\ExpressionBuilder;
|
||||
|
|
@ -104,7 +104,7 @@ class QueryBuilder implements IQueryBuilder {
|
|||
if ($this->connection->getDatabasePlatform() instanceof MySQLPlatform) {
|
||||
return new MySqlExpressionBuilder($this->connection, $this);
|
||||
}
|
||||
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof SQLitePlatform) {
|
||||
return new SqliteExpressionBuilder($this->connection, $this);
|
||||
}
|
||||
|
||||
|
|
@ -131,7 +131,7 @@ class QueryBuilder implements IQueryBuilder {
|
|||
if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) {
|
||||
return new OCIFunctionBuilder($this->connection, $this, $this->helper);
|
||||
}
|
||||
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof SQLitePlatform) {
|
||||
return new SqliteFunctionBuilder($this->connection, $this, $this->helper);
|
||||
}
|
||||
if ($this->connection->getDatabasePlatform() instanceof PostgreSQL94Platform) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace Test\DB;
|
|||
use Doctrine\DBAL\Exception;
|
||||
use Doctrine\DBAL\ParameterType;
|
||||
use Doctrine\DBAL\Platforms\OraclePlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Platforms\SQLitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\DBAL\Schema\SchemaConfig;
|
||||
use OC\DB\Migrator;
|
||||
|
|
@ -59,7 +59,7 @@ class MigratorTest extends \Test\TestCase {
|
|||
$platform = $this->connection->getDatabasePlatform();
|
||||
$random = \OC::$server->get(ISecureRandom::class);
|
||||
$dispatcher = \OC::$server->get(\OCP\EventDispatcher\IEventDispatcher::class);
|
||||
if ($platform instanceof SqlitePlatform) {
|
||||
if ($platform instanceof SQLitePlatform) {
|
||||
return new SQLiteMigrator($this->connection, $this->config, $dispatcher);
|
||||
} elseif ($platform instanceof OraclePlatform) {
|
||||
return new OracleMigrator($this->connection, $this->config, $dispatcher);
|
||||
|
|
|
|||
Loading…
Reference in a new issue