From 385bde1e46db293d08a93f206529df5deee5d876 Mon Sep 17 00:00:00 2001 From: patrick1100 <90774296+patrick1100@users.noreply.github.com> Date: Wed, 3 Jul 2024 14:50:30 +0200 Subject: [PATCH 1/3] Add DBTypes that are missing for TypeMapping See: https://github.com/doctrine/dbal/issues/6259 --- src/Platforms/SQLServerPlatform.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Platforms/SQLServerPlatform.php b/src/Platforms/SQLServerPlatform.php index a4e81c6e5e4..32bff6fbae2 100644 --- a/src/Platforms/SQLServerPlatform.php +++ b/src/Platforms/SQLServerPlatform.php @@ -1559,12 +1559,14 @@ protected function initializeDoctrineTypeMappings() 'smalldatetime' => Types::DATETIME_MUTABLE, 'smallint' => Types::SMALLINT, 'smallmoney' => Types::INTEGER, + 'sysname' => Types::STRING, 'text' => Types::TEXT, 'time' => Types::TIME_MUTABLE, 'tinyint' => Types::SMALLINT, 'uniqueidentifier' => Types::GUID, 'varbinary' => Types::BINARY, 'varchar' => Types::STRING, + 'xml' => Types::TEXT, ]; } From 2e97b06f88af235b9f5d39d35f34cefdf1da13f7 Mon Sep 17 00:00:00 2001 From: patrick1100 <90774296+patrick1100@users.noreply.github.com> Date: Thu, 4 Jul 2024 13:50:33 +0200 Subject: [PATCH 2/3] Add sysname and xml to typemappingtest --- tests/Platforms/SQLServerPlatformTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/Platforms/SQLServerPlatformTest.php b/tests/Platforms/SQLServerPlatformTest.php index 4cb48bc59ab..532b935f3e5 100644 --- a/tests/Platforms/SQLServerPlatformTest.php +++ b/tests/Platforms/SQLServerPlatformTest.php @@ -1145,6 +1145,12 @@ public function testInitializesDoctrineTypeMappings(): void self::assertTrue($this->platform->hasDoctrineTypeMappingFor('uniqueidentifier')); self::assertSame(Types::GUID, $this->platform->getDoctrineTypeMapping('uniqueidentifier')); + + self::assertTrue($this->platform->hasDoctrineTypeMappingFor('sysname')); + self::assertSame(Types::STRING, $this->platform->getDoctrineTypeMapping('sysname')); + + self::assertTrue($this->platform->hasDoctrineTypeMappingFor('xml')); + self::assertSame(Types::Text, $this->platform->getDoctrineTypeMapping('xml')); } protected function getBinaryMaxLength(): int From 13b8ba0127293984635fc30c7e073133440b9482 Mon Sep 17 00:00:00 2001 From: patrick1100 <90774296+patrick1100@users.noreply.github.com> Date: Thu, 4 Jul 2024 13:54:04 +0200 Subject: [PATCH 3/3] Update SQLServerPlatformTest.php --- tests/Platforms/SQLServerPlatformTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Platforms/SQLServerPlatformTest.php b/tests/Platforms/SQLServerPlatformTest.php index 532b935f3e5..d3cc6edf4df 100644 --- a/tests/Platforms/SQLServerPlatformTest.php +++ b/tests/Platforms/SQLServerPlatformTest.php @@ -1150,7 +1150,7 @@ public function testInitializesDoctrineTypeMappings(): void self::assertSame(Types::STRING, $this->platform->getDoctrineTypeMapping('sysname')); self::assertTrue($this->platform->hasDoctrineTypeMappingFor('xml')); - self::assertSame(Types::Text, $this->platform->getDoctrineTypeMapping('xml')); + self::assertSame(Types::TEXT, $this->platform->getDoctrineTypeMapping('xml')); } protected function getBinaryMaxLength(): int