Skip to content

Commit 677746e

Browse files
authored
Add DBTypes that are missing for TypeMapping (#6463)
| Q | A |------------- | ----------- | Type | bug | Fixed issues | #6259 #### Summary We've got error because of missing DBTypes on SQLSRV. "Unknown database type sysname requested, Doctrine\DBAL\Platforms\SQLServer2012Platform may not support it.". Once for 'sysname' and for 'xml'.
1 parent 613798a commit 677746e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Platforms/SQLServerPlatform.php

+2
Original file line numberDiff line numberDiff line change
@@ -1559,12 +1559,14 @@ protected function initializeDoctrineTypeMappings()
15591559
'smalldatetime' => Types::DATETIME_MUTABLE,
15601560
'smallint' => Types::SMALLINT,
15611561
'smallmoney' => Types::INTEGER,
1562+
'sysname' => Types::STRING,
15621563
'text' => Types::TEXT,
15631564
'time' => Types::TIME_MUTABLE,
15641565
'tinyint' => Types::SMALLINT,
15651566
'uniqueidentifier' => Types::GUID,
15661567
'varbinary' => Types::BINARY,
15671568
'varchar' => Types::STRING,
1569+
'xml' => Types::TEXT,
15681570
];
15691571
}
15701572

tests/Platforms/SQLServerPlatformTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,12 @@ public function testInitializesDoctrineTypeMappings(): void
11451145

11461146
self::assertTrue($this->platform->hasDoctrineTypeMappingFor('uniqueidentifier'));
11471147
self::assertSame(Types::GUID, $this->platform->getDoctrineTypeMapping('uniqueidentifier'));
1148+
1149+
self::assertTrue($this->platform->hasDoctrineTypeMappingFor('sysname'));
1150+
self::assertSame(Types::STRING, $this->platform->getDoctrineTypeMapping('sysname'));
1151+
1152+
self::assertTrue($this->platform->hasDoctrineTypeMappingFor('xml'));
1153+
self::assertSame(Types::TEXT, $this->platform->getDoctrineTypeMapping('xml'));
11481154
}
11491155

11501156
protected function getBinaryMaxLength(): int

0 commit comments

Comments
 (0)