Skip to content

Support the UUID field type - #33

Open
crishoj wants to merge 1 commit into
iamcal:masterfrom
crishoj:support-uuid-field-type
Open

Support the UUID field type#33
crishoj wants to merge 1 commit into
iamcal:masterfrom
crishoj:support-uuid-field-type

Conversation

@crishoj

@crishoj crishoj commented Aug 31, 2026

Copy link
Copy Markdown

Written by Claude, at Christian's request.

CREATE TABLE foo (bar UUID) currently throws Unsupported field type: UUID.

MariaDB has had a native UUID type since 10.7, PostgreSQL has one too, and Laravel's $table->uuid() emits the native type rather than CHAR(36) on those platforms — so it shows up in ordinary mysqldump/mariadb-dump output. In our schema it is four columns across four tables, which was enough to make the whole dump unparseable, since parse() fails on the first unsupported type it meets.

UUID takes no length, precision, charset or collation, so it belongs with the other argument-less types — added next to JSON in that group, and to the type list the test documents.

The added assertion in testSimpleFields fails on master with Unsupported field type: UUID and passes with the change.

I ran the suite under PHPUnit 12 (the pinned ^5|^6|^7|^8|^9 will not resolve on PHP 8.4). Everything passes except a pre-existing FullTest::testBasicCases failure, which is a data-provider incompatibility with newer PHPUnit and unrelated to this change.

Context, in case it is useful: this surfaces downstream in Larastan, where the parse failure is caught and discarded silently, so a Laravel project on MariaDB gets no model column types at all with no indication why — larastan/larastan#2228.

MariaDB 10.7+ and PostgreSQL both have a native UUID column type, and
Laravel's $table->uuid() emits it, so it turns up in ordinary schema dumps.
The parser rejected it outright with 'Unsupported field type: UUID'.

UUID takes no length, precision or charset, so it belongs with the other
argument-less types alongside JSON and DATE.
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.

1 participant