Commit ba72049
committed
fix(cli):
`os generate types` honoured the flag and neither migration generator did, so
one authored `Field.lookup({ multiple: true })` produced an array TS type and a
scalar `VARCHAR(36)` / `table.uuid` column from the same config in the same run.
The column authority is `driver-sql`, and its answer is the flag alone:
`createColumn` short-circuits on `field.multiple` above its own per-type switch,
`isJsonField` is `JSON_COLUMN_TYPES.has(type) || !!field.multiple`, and
`fieldHasColumn` opens with the same check. Both generators now answer it in the
same place — before the type is consulted — so the element type gets no vote.
Deliberately NOT the spec's `isMultiValueField`: that is the ADR-0104 D1 value
contract, gated on `MULTI_CAPABLE_TYPES`, and it would answer VARCHAR for a
`text` field the driver gives a JSON column — the same drift one notch narrower.
The per-type vocabularies are untouched; the disputed scalar answers stay
byte-for-byte and are pinned as a scope fence.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016yfqQh2dBgPAymYd7xipzamultiple: true takes a JSON column in both migration generators1 parent a59b393 commit ba72049
4 files changed
Lines changed: 77 additions & 4 deletions
File tree
- .changeset
- packages/cli/src/commands
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1027 | 1027 | | |
1028 | 1028 | | |
1029 | 1029 | | |
1030 | | - | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1031 | 1057 | | |
1032 | 1058 | | |
1033 | 1059 | | |
| |||
1063 | 1089 | | |
1064 | 1090 | | |
1065 | 1091 | | |
1066 | | - | |
| 1092 | + | |
1067 | 1093 | | |
1068 | 1094 | | |
1069 | 1095 | | |
| |||
1117 | 1143 | | |
1118 | 1144 | | |
1119 | 1145 | | |
1120 | | - | |
1121 | 1146 | | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
1122 | 1161 | | |
1123 | 1162 | | |
1124 | 1163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
394 | 415 | | |
395 | 416 | | |
396 | 417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
0 commit comments