mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Added support of the custom TinyInt type for postgres
This commit is contained in:
parent
5402d7bedb
commit
d202ecf06f
1 changed files with 9 additions and 1 deletions
|
@ -22,7 +22,9 @@ declare(strict_types=1);
|
|||
*/
|
||||
namespace App\Doctrine\Types;
|
||||
|
||||
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Types\Type;
|
||||
|
||||
/**
|
||||
|
@ -33,7 +35,13 @@ class TinyIntType extends Type
|
|||
|
||||
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
|
||||
{
|
||||
return 'TINYINT';
|
||||
//MySQL and SQLite know the TINYINT type directly
|
||||
if ($platform instanceof AbstractMySQLPlatform || $platform instanceof SqlitePlatform) {
|
||||
return 'TINYINT';
|
||||
}
|
||||
|
||||
//For other platforms, we use the smallest integer type available
|
||||
return $platform->getSmallIntTypeDeclarationSQL($column);
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue