Support the UUID field type - #33
Open
crishoj wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Written by Claude, at Christian's request.
CREATE TABLE foo (bar UUID)currently throwsUnsupported field type: UUID.MariaDB has had a native
UUIDtype since 10.7, PostgreSQL has one too, and Laravel's$table->uuid()emits the native type rather thanCHAR(36)on those platforms — so it shows up in ordinarymysqldump/mariadb-dumpoutput. In our schema it is four columns across four tables, which was enough to make the whole dump unparseable, sinceparse()fails on the first unsupported type it meets.UUIDtakes no length, precision, charset or collation, so it belongs with the other argument-less types — added next toJSONin that group, and to the type list the test documents.The added assertion in
testSimpleFieldsfails onmasterwithUnsupported field type: UUIDand passes with the change.I ran the suite under PHPUnit 12 (the pinned
^5|^6|^7|^8|^9will not resolve on PHP 8.4). Everything passes except a pre-existingFullTest::testBasicCasesfailure, 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.