Skip to content

Commit

Permalink
Map nativeuuid phinx type when the database type is uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosp committed Dec 10, 2024
1 parent 8303d1a commit b042de9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Db/Adapter/MysqlAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check warning on line 1193 in src/Db/Adapter/MysqlAdapter.php

View check run for this annotation

Codecov / codecov/patch

src/Db/Adapter/MysqlAdapter.php#L1191-L1193

Added lines #L1191 - L1193 were not covered by tests
}

try {
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Db/Adapter/MysqlAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b042de9

Please sign in to comment.