diff --git a/composer.json b/composer.json index 6e566c788..6141244f9 100644 --- a/composer.json +++ b/composer.json @@ -35,13 +35,13 @@ "require": { "php": ">=7.4 <8.3", "atk4/core": "dev-develop", - "doctrine/dbal": "~3.4.5", + "doctrine/dbal": "~3.4.5 || ~3.5.1 || ~3.6.0", "mvorisek/atk4-hintable": "~1.9.0" }, "require-release": { "php": ">=7.4 <8.3", "atk4/core": "~5.0.0", - "doctrine/dbal": "~3.4.5", + "doctrine/dbal": "~3.4.5 || ~3.5.1 || ~3.6.0", "mvorisek/atk4-hintable": "~1.9.0" }, "require-dev": { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 040aabb81..034dfc542 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -36,6 +36,16 @@ parameters: path: '*' count: 3 + # TODO for DBAL 4.0 upgrade + - + message: '~^Instantiation of deprecated class Doctrine\\DBAL\\Event\\Listeners\\OracleSessionInit:\nUse \{@see \\Doctrine\\DBAL\\Driver\\OCI8\\Middleware\\InitializeSession\} instead\.$~' + path: 'src/Persistence/Sql/Oracle/Connection.php' + count: 1 + - + message: '~^(Fetching deprecated class constant postConnect of class Doctrine\\DBAL\\Events\.|Fetching class constant postConnect of deprecated class Doctrine\\DBAL\\Events\.|Parameter \$args of method postConnect\(\) in anonymous class has typehint with deprecated class Doctrine\\DBAL\\Event\\ConnectionEventArgs\.)$~' + path: 'src/Persistence/Sql/Sqlite/Connection.php' + count: 3 + # TODO these rules are generated, this ignores should be fixed in the code # for src/Schema/TestCase.php - '~^Call to an undefined method Atk4\\Data\\Persistence::dsql\(\)\.$~' diff --git a/src/Persistence/Sql/Sqlite/SchemaManagerTrait.php b/src/Persistence/Sql/Sqlite/SchemaManagerTrait.php index 6e32377ec..fc9304e86 100644 --- a/src/Persistence/Sql/Sqlite/SchemaManagerTrait.php +++ b/src/Persistence/Sql/Sqlite/SchemaManagerTrait.php @@ -30,6 +30,21 @@ public function alterTable(TableDiff $tableDiff): void } } + // fix collations unescape for SqliteSchemaManager::parseColumnCollationFromSQL() method + // https://github.com/doctrine/dbal/issues/6129 + + protected function _getPortableTableColumnList($table, $database, $tableColumns) + { + $res = parent::_getPortableTableColumnList($table, $database, $tableColumns); + foreach ($res as $column) { + if ($column->hasPlatformOption('collation')) { + $column->setPlatformOption('collation', $this->unquoteTableIdentifier($column->getPlatformOption('collation'))); + } + } + + return $res; + } + // fix quoted table name support for private SqliteSchemaManager::getCreateTableSQL() method // https://github.com/doctrine/dbal/blob/3.3.7/src/Schema/SqliteSchemaManager.php#L539 // TODO submit a PR with fixed SqliteSchemaManager to DBAL