From b042de97620897da9834672e843ddbf9483fdd8f Mon Sep 17 00:00:00 2001 From: Nicos Panayides Date: Tue, 10 Dec 2024 16:42:57 +0200 Subject: [PATCH] Map nativeuuid phinx type when the database type is uuid --- src/Db/Adapter/MysqlAdapter.php | 4 ++++ tests/TestCase/Db/Adapter/MysqlAdapterTest.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Db/Adapter/MysqlAdapter.php b/src/Db/Adapter/MysqlAdapter.php index a84230fe..954ae353 100644 --- a/src/Db/Adapter/MysqlAdapter.php +++ b/src/Db/Adapter/MysqlAdapter.php @@ -1187,6 +1187,10 @@ public function getPhinxType(string $sqlTypeDef): array $type = static::PHINX_TYPE_BINARYUUID; } break; + case 'uuid': + $type = static::PHINX_TYPE_NATIVEUUID; + $limit = null; + break; } try { diff --git a/tests/TestCase/Db/Adapter/MysqlAdapterTest.php b/tests/TestCase/Db/Adapter/MysqlAdapterTest.php index 60596289..7c8873de 100644 --- a/tests/TestCase/Db/Adapter/MysqlAdapterTest.php +++ b/tests/TestCase/Db/Adapter/MysqlAdapterTest.php @@ -2552,7 +2552,7 @@ public function testGetPhinxTypeFromSQLDefinition(string $sqlDefinition, array $ $this->assertSame($expectedResponse['limit'], $result['limit'], "Field upper boundary mismatch - got '{$result['limit']}' when expecting '{$expectedResponse['limit']}'"); } - public function testGetPhinxType() + public function testGetSqlType() { if (!$this->usingMariaDbWithUuid()) { $this->expectException(UnsupportedColumnTypeException::class);