Skip to content

fix: map native uuid column types to string - #129

Merged
tcampbPPU merged 1 commit into
fumeapp:masterfrom
felipesauer:fix/uuid-column-type
Sep 25, 2026
Merged

tcampbPPU merged 1 commit into
fumeapp:masterfrom
felipesauer:fix/uuid-column-type

Conversation

@felipesauer

Copy link
Copy Markdown
Contributor

Fixes #107

Problem

UUID columns are generated as unknown instead of string. Since Laravel 11 the column type comes from the database schema instead of Doctrine DBAL, so $table->uuid() is reported as:

Driver Column type Before After
PostgreSQL uuid unknown string
MariaDB 10.7+ uuid unknown string
SQL Server uniqueidentifier unknown string
MySQL char(36) string string
SQLite varchar string string

The existing guid entry (#52) is the Doctrine DBAL name, which Laravel no longer reports, and uuid was not part of the Laravel 11 mappings added after #71.

Solution

Add uuid and uniqueidentifier to the native column type mappings, next to char, varchar and the other types from #71.

Tests

The test suite runs on SQLite, where uuid columns already map to string, so the new test calls MapReturnType directly with the real mappings from GetMappings. It fails before the change (unknown) and passes after it. Locally on PHP 8.4: 131 tests passing, pint --test and phpstan clean.

Since Laravel 11 the column type comes from the database schema instead
of Doctrine DBAL, so uuid columns report `uuid` (PostgreSQL, MariaDB)
or `uniqueidentifier` (SQL Server). Neither was in the mappings, and
MapReturnType fell back to `unknown`.
@tcampbPPU
tcampbPPU merged commit 94a58a4 into fumeapp:master Sep 25, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] UUID column is unknown

2 participants