fix(database): resolve uuid primary keys from positional insert bindings - #2301
radoslav-grencik wants to merge 3 commits into
Conversation
…n keys Iterable inserts (`insert()` with array data) never generated `#[Uuid]` primary keys — only the object path (`create()`, `save()`) did — so UUID models inserted this way ended up with a NULL key (error 1364 on MySQL). Migrations also had no way to define UUID-typed foreign key columns: `belongsTo()`/`foreignId()` always compile INTEGER, which cannot reference a UUID primary key (fails on PostgreSQL). - generate `#[Uuid]` values in the iterable insert path when the key is absent (explicitly provided ids are never overwritten) - add `uuidColumn()`, `belongsToUuid()` and `foreignUuid()` to `CreateTableStatement` (CHAR(36) / UUID / TEXT per dialect)
Benchmark ResultsComparison of Open to see the benchmark results
Generated by phpbench against commit 4d7d1ed |
What this PR doesFixes relation auto-inserts for models with 1. Bug fix:
|
Fixes #2300