Commit 536bab7
buildExpectedSchema dropped `@default: ""` via a falsy `defaultRaw.length > 0` guard, so a
`field.string @default: ""` column read as "no default" — perpetually drifting against a DB
that has `DEFAULT ''` (a destructive recreate-and-copy on every sqlite/d1 migrate) and
disagreeing with codegen (Drizzle emits `.default("")`). Only `undefined` now means "no
default"; `""` is kept as a literal (an empty string is never an expr).
Gated by the real-SQLite default-semantics round-trip: the shared Photo META gains a
`@default: ""` field, so the IDEMPOTENCE test (emit → apply → introspect → re-diff EMPTY) now
covers it, plus a value-semantics assertion (emits `DEFAULT ''`, a seeded row stores the empty
string, not NULL). Introspection already parsed `DEFAULT ''` correctly; the bug was only the
expected-side falsy check. TS-only (schema is TS-owned, ADR-0015).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014xy8powhHYJ6gfFt9Ut8dL
1 parent 3f33d86 commit 536bab7
3 files changed
Lines changed: 31 additions & 2 deletions
File tree
- server/typescript/packages/migrate-ts
- src
- test/integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
10 | 21 | | |
11 | 22 | | |
12 | 23 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
869 | 869 | | |
870 | 870 | | |
871 | 871 | | |
872 | | - | |
873 | | - | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
874 | 878 | | |
875 | 879 | | |
876 | 880 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
143 | 157 | | |
0 commit comments