Conversation
| public function compile(DatabaseDialect $dialect): string | ||
| { | ||
| return match ($dialect) { | ||
| DatabaseDialect::MYSQL => sprintf('`%s` VARCHAR(36) PRIMARY KEY', $this->name), |
Contributor
There was a problem hiding this comment.
(I read this while reading the Tempest 3.0 announcement, thanks for your work on this guys)
VARCHAR(36) is not the optimal datatype. I do not know what is feasible with tempest.
- A
CHAR(36)should be better - An old article https://dev.mysql.com/blog-archive/storing-uuid-values-in-mysql-tables/ using
BINARY(16). - UUID Support in MySQL8 https://dev.mysql.com/blog-archive/mysql-8-0-uuid-support/ (still uses
BINARY(16)
Also, I do not know how MariaDB is handled, but they have an UUID type: https://mariadb.com/docs/server/reference/data-types/string-data-types/uuid-data-type
(I do not know about sqlite)
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.
Closes #619
This pull request adds support for generating UUID v7 primary keys during insertion. Note that since
IsDatabaseModelprovides aidproperty, which cannot be extended to receive the#[Uuid]attribute, this feature is technically not compatible withIsDatabaseModel.