|
1 | 1 | # Changelog |
2 | 2 |
|
| 3 | +## 6.0.0-next.4 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- 300d024: fix: only treat `@db.Uuid` columns as UUIDs — drop field-name inference |
| 8 | + |
| 9 | + `isUuidField` previously had a third detection tier that inferred UUID from the |
| 10 | + field _name_ (`/^id$/`, `/_id$/`, `/^.*_uuid$/`, `/^uuid$/`) for any `String` |
| 11 | + column. UUID is a column _type_, not a naming convention, so this was a |
| 12 | + false-positive generator: every external-system identifier stored as text — most |
| 13 | + notably Stripe IDs (`acct_…`, `cus_…`, `sub_…`, `price_…`, `txn_…`, `ch_…`, |
| 14 | + `evt_…`), plus slugs and provider/session references — ends in `_id` without |
| 15 | + being a UUID. The generator emitted `Schema.String.check(Schema.isUUID())` for |
| 16 | + those columns, and decoding real data threw `Die`/`ParseError` |
| 17 | + ("Expected a UUID, got \"acct\_…\"") at runtime. |
| 18 | + |
| 19 | + Prisma always records a genuine `uuid` column via the `@db.Uuid` native type (a |
| 20 | + bare `String` maps to `text`), so the native-type and `@db.Uuid`-documentation |
| 21 | + checks already capture 100% of real UUID columns. The name-pattern tier only |
| 22 | + ever contradicted that authoritative information, so it has been removed. |
| 23 | + |
| 24 | + `isUuidField` now returns true only when: |
| 25 | + 1. `field.nativeType[0] === 'Uuid'` (a `@db.Uuid` column), or |
| 26 | + 2. the field documentation includes `@db.Uuid`. |
| 27 | + |
| 28 | + **Migration:** columns that are genuinely UUID-typed are unaffected (they carry |
| 29 | + `@db.Uuid`). Columns that were relying on name inference to get UUID validation |
| 30 | + lose it — which is the fix, since they were text. To keep an explicit UUID check |
| 31 | + on a non-`@db.Uuid` column, add `/// @db.Uuid` to the field, or override its |
| 32 | + schema with `/// @customType(...)`. |
| 33 | + |
3 | 34 | ## 6.0.0-next.3 |
4 | 35 |
|
5 | 36 | ### Patch Changes |
|
0 commit comments