mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-10 01:08:38 +01:00
Fixed doctrine middlewares
We now look directly onto the driver arguments instead of retrieving a database platform, for which we would need the database version. As we modify driver specific options there, this might be the better choice anyway
This commit is contained in:
@@ -35,7 +35,7 @@ class SetSQLModeMiddlewareDriver extends AbstractDriverMiddleware
|
||||
public function connect(array $params): Connection
|
||||
{
|
||||
//Only set this on MySQL connections, as other databases don't support this parameter
|
||||
if($this->getDatabasePlatform() instanceof AbstractMySQLPlatform) {
|
||||
if($params['driver'] === 'pdo_mysql') {
|
||||
//1002 is \PDO::MYSQL_ATTR_INIT_COMMAND constant value
|
||||
$params['driverOptions'][\PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET SESSION sql_mode=(SELECT REPLACE(@@sql_mode, \'ONLY_FULL_GROUP_BY\', \'\'))';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user