mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Use platforms to decide which migrations to use, instead of drivers
Dev environment uses an delegated dev driver, which is not possible to compare. Should fix current phpunit test error.
This commit is contained in:
parent
2de99bca30
commit
c079cc914e
1 changed files with 5 additions and 2 deletions
|
@ -8,6 +8,9 @@ use Doctrine\DBAL\Driver\AbstractMySQLDriver;
|
||||||
use Doctrine\DBAL\Driver\AbstractSQLiteDriver;
|
use Doctrine\DBAL\Driver\AbstractSQLiteDriver;
|
||||||
use Doctrine\DBAL\Exception;
|
use Doctrine\DBAL\Exception;
|
||||||
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
|
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\MariaDBPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||||
|
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
@ -124,11 +127,11 @@ abstract class AbstractMultiPlatformMigration extends AbstractMigration
|
||||||
*/
|
*/
|
||||||
public function getDatabaseType(): ?string
|
public function getDatabaseType(): ?string
|
||||||
{
|
{
|
||||||
if ($this->connection->getDriver() instanceof AbstractMySQLDriver) {
|
if ($this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform) {
|
||||||
return 'mysql';
|
return 'mysql';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->connection->getDriver() instanceof AbstractSQLiteDriver) {
|
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||||
return 'sqlite';
|
return 'sqlite';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue