Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏗️ chore(deps): Bump doctrine/dbal from 3.8.3 to 4.0.4 #46192

Draft
wants to merge 51 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
c239495
chore(deps): Bump doctrine/dbal from 3.8.3 to 4.0.4
nickvergessen Jun 28, 2024
015a3e8
fix(db)!: Fix casing of doctrine's SQLitePlatform
nickvergessen Jun 28, 2024
a5432e3
fix(db): Adjust Connection signature to updated doctrine one
nickvergessen Jun 28, 2024
de0141d
fix(db)!: Empty and adjust query-part related methods
nickvergessen Jun 28, 2024
72886c0
fix(db): Make sure setComment() is only called with strings
nickvergessen Jun 28, 2024
6d0e8e4
fix(db): Use new function name to get the schema
nickvergessen Jun 28, 2024
76ef7dd
fix(db): Remove usage of dropped doctrine event manager
nickvergessen Jun 28, 2024
648b20c
fix(db)!: Manually track the query type and whether WHERE is empty
nickvergessen Jun 28, 2024
e6e1bd8
fix(db): Fix internal calls to doctrine's fetch functions
nickvergessen Jun 28, 2024
f6f53a8
fix(db)!: Doctrine\DBAL\Types\Type::getName() was removed
nickvergessen Jul 1, 2024
27c49e7
fix(db)!: Table::changeColumn() was renamed to Table::modifyColumn()
nickvergessen Jul 1, 2024
466f455
fix(db)!: `Doctrine\DBAL\Schema\Table::hasPrimaryKey() was removed, u…
nickvergessen Jul 1, 2024
287d527
fix(db)!: `Doctrine\DBAL\Connection::getSchemaManager` was removed, u…
nickvergessen Jul 1, 2024
3c5acbc
fix(db): `Doctrine\DBAL\Connection::executeUpdate()` was removed
nickvergessen Jul 1, 2024
f45ac5b
fix(db): `Doctrine\DBAL\Query\Expression\ExpressionBuilder::andX()` a…
nickvergessen Jul 1, 2024
72151b5
fix(db): `Table::getPrimaryKeyColumns()` was removed
nickvergessen Jul 1, 2024
a20110b
fix(db): UndefinedConstant: Constant Doctrine\DBAL\Connection::PARAM_…
nickvergessen Jul 1, 2024
c0d2f7e
fix(CI): Operand of type Doctrine\DBAL\Schema\Column is always truthy
nickvergessen Jul 1, 2024
fb3d4d5
fix(db): Don't use removed/deprecated methods in setup
nickvergessen Jul 1, 2024
2d27a32
fix(db): InaccessibleMethod: Cannot access private method Doctrine\DB…
nickvergessen Jul 1, 2024
d9e69e1
fix(db)!: Table alias for DELETE and UPDATE no longer supported
nickvergessen Jul 1, 2024
f6ac69a
fix(db)!: `Doctrine\DBAL\Platforms\PostgreSQL94Platform` was removed
nickvergessen Jul 1, 2024
c6cd20e
fix(db)!: `Doctrine\DBAL\FetchMode` was removed
nickvergessen Jul 1, 2024
1654430
fix(db): Interface `Doctrine\DBAL\Exception` cannot be instantiated
nickvergessen Jul 1, 2024
4c10031
fix(db): `Doctrine\DBAL\Schema\Schema::getTableNames()` was removed
nickvergessen Jul 1, 2024
ec1a3d6
fix(db): `Doctrine\DBAL\Query\QueryBuilder::getState` does not exist
nickvergessen Jul 1, 2024
6e90ddf
fix(db): `Doctrine\DBAL\Query\Expression\CompositeExpression::add*` d…
nickvergessen Jul 1, 2024
4bbaae5
fix(db): `ExpressionBuilder::like` expects string, but `OCP\DB\QueryB…
nickvergessen Jul 1, 2024
2b83016
fix(db): TooManyArguments: Too many arguments for method `Doctrine\DB…
nickvergessen Jul 1, 2024
55a8f33
fix(db): Doctrine Event Manager is removed
nickvergessen Jul 1, 2024
5823d58
fix(db)!: `Doctrine\DBAL\Platforms\MySQL80Platform` requires the leng…
nickvergessen Jul 2, 2024
e8ef23d
fix(db): Too few arguments for `Doctrine\DBAL\Driver::getDatabasePlat…
nickvergessen Jul 2, 2024
df7d088
fix(db)!: Deprecate getDatabasePlatform which leaks 3rdparty
nickvergessen Jul 2, 2024
60217aa
fix(db): No longer return result of `Connection::connect()`
nickvergessen Jul 2, 2024
926f2ab
fix(db): Too many arguments for method `\Doctrine\DBAL\Connection::qu…
nickvergessen Jul 2, 2024
bae31bf
fix(db): Method `\Doctrine\DBAL\Platforms\AbstractPlatform::getIdenti…
nickvergessen Jul 2, 2024
7156569
fix(db): Argument 2 of `\Doctrine\DBAL\Platforms\AbstractPlatform::ge…
nickvergessen Jul 2, 2024
66aac18
fix(db)!: `OCP\DB\IPreparedStatement::bindParam()` is deprecated and …
nickvergessen Jul 2, 2024
98b6c7c
fix(db): Add a hint that we return PHP_INT_MAX
nickvergessen Jul 2, 2024
6b2f136
fix(db): Map parameter types to doctrine's enums
nickvergessen Jul 2, 2024
1370693
fix(db): Remove usage of Platforms
nickvergessen Jul 2, 2024
de5a7c3
fix(db)!: Reimplement the query logger with a doctrine middleware
nickvergessen Jul 3, 2024
8153c38
fix(db): Don't set null as type
nickvergessen Jul 3, 2024
fc383a3
fix(tests): Adjust the migrator test
nickvergessen Jul 3, 2024
4c80fdd
fix(db): Adjust unit tests of query builder
nickvergessen Jul 3, 2024
5718e8f
fix(tests): Fix changes in doctrine's Exception handling
nickvergessen Jul 3, 2024
f0348be
fix(db): Replace more Platform usages
nickvergessen Jul 4, 2024
b2cf45c
fix(tests): Add length to test columns that bypass the migration service
nickvergessen Jul 4, 2024
72c8c3a
fix(tests): Adjust postgres schema diffing
nickvergessen Jul 4, 2024
8b7f8e1
fix(tests): Also handle the case where the schema is cached and the D…
nickvergessen Jul 4, 2024
5fdc5d5
fix(db)!: Too few arguments to function `Doctrine\DBAL\Query\Expressi…
nickvergessen Jul 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(tests): Adjust the migrator test
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Jul 4, 2024
commit fc383a323fa1e4d8bfa4519b8d9a26cfa255b1c4
28 changes: 16 additions & 12 deletions tests/lib/DB/MigratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
use OC\DB\Migrator;
use OC\DB\OracleMigrator;
use OC\DB\SQLiteMigrator;
use OC\DB\TDoctrineParameterTypeMap;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\DB\Types;
use OCP\IConfig;
use OCP\Security\ISecureRandom;
Expand All @@ -29,6 +31,8 @@
* @package Test\DB
*/
class MigratorTest extends \Test\TestCase {
use TDoctrineParameterTypeMap;

/**
* @var \Doctrine\DBAL\Connection $connection
*/
Expand Down Expand Up @@ -74,12 +78,12 @@ private function getUniqueTableName() {
protected function tearDown(): void {
// Try to delete if exists (IF EXISTS NOT SUPPORTED IN ORACLE)
try {
$this->connection->exec('DROP TABLE ' . $this->connection->quoteIdentifier($this->tableNameTmp));
$this->connection->executeStatement('DROP TABLE ' . $this->connection->quoteIdentifier($this->tableNameTmp));
} catch (Exception $e) {
}

try {
$this->connection->exec('DROP TABLE ' . $this->connection->quoteIdentifier($this->tableName));
$this->connection->executeStatement('DROP TABLE ' . $this->connection->quoteIdentifier($this->tableName));
} catch (Exception $e) {
}
parent::tearDown();
Expand Down Expand Up @@ -267,28 +271,28 @@ public function testAddingForeignKey() {

public function dataNotNullEmptyValuesFailOracle(): array {
return [
[ParameterType::BOOLEAN, true, Types::BOOLEAN, false],
[ParameterType::BOOLEAN, false, Types::BOOLEAN, true],
[IQueryBuilder::PARAM_BOOL, true, Types::BOOLEAN, false],
[IQueryBuilder::PARAM_BOOL, false, Types::BOOLEAN, true],

[ParameterType::STRING, 'foo', Types::STRING, false],
[ParameterType::STRING, '', Types::STRING, true],
[IQueryBuilder::PARAM_STR, 'foo', Types::STRING, false],
[IQueryBuilder::PARAM_STR, '', Types::STRING, true],

[ParameterType::INTEGER, 1234, Types::INTEGER, false],
[ParameterType::INTEGER, 0, Types::INTEGER, false], // Integer 0 is not stored as Null and therefor works
[IQueryBuilder::PARAM_INT, 1234, Types::INTEGER, false],
[IQueryBuilder::PARAM_INT, 0, Types::INTEGER, false], // Integer 0 is not stored as Null and therefor works

[ParameterType::STRING, '{"a": 2}', Types::JSON, false],
[IQueryBuilder::PARAM_JSON, '{"a": 2}', Types::JSON, false],
];
}

/**
* @dataProvider dataNotNullEmptyValuesFailOracle
*
* @param int $parameterType
* @param int|string $parameterType
* @param bool|int|string $value
* @param string $columnType
* @param bool $oracleThrows
*/
public function testNotNullEmptyValuesFailOracle(int $parameterType, $value, string $columnType, bool $oracleThrows): void {
public function testNotNullEmptyValuesFailOracle(int|string $parameterType, bool|int|string $value, string $columnType, bool $oracleThrows): void {
$startSchema = new Schema([], [], $this->getSchemaConfig());
$table = $startSchema->createTable($this->tableName);
$table->addColumn('id', Types::BIGINT);
Expand All @@ -308,7 +312,7 @@ public function testNotNullEmptyValuesFailOracle(int $parameterType, $value, str
$this->connection->insert(
$this->tableName,
['id' => 1, 'will_it_blend' => $value],
['id' => ParameterType::INTEGER, 'will_it_blend' => $parameterType],
['id' => ParameterType::INTEGER, 'will_it_blend' => $this->convertParameterTypeToDoctrine($parameterType)],
);

$this->addToAssertionCount(1);
Expand Down