Problem
An empty-string column default (@default: "") is handled inconsistently between codegen and the migrate/verify path on sqlite/d1:
- Codegen (Drizzle) emits
.default("") — keeps it.
buildExpectedSchema / the diff appears to DROP the empty-string default (treats "" as absent), so meta verify --dialect d1 reports the column as drift against a DB that has DEFAULT '', and meta migrate won't reconcile it.
Non-empty defaults (0, 'abstains', '[]') round-trip fine; only the empty string is dropped — a classic falsy-"" bug.
Repro
Model a field.string @default: "" on an entity, generate + apply to sqlite/d1 (column gets DEFAULT ''), then meta verify --dialect d1 → the column reports change-column-default drift even though metadata and DB agree.
Impact
A consumer either can't declare an empty-string default (it perpetually drifts) or gets a codegen-vs-migrate disagreement (Drizzle says .default(""), the DB rebuild drops it). Surfaced while reconciling a reference-impl's D1 schema; worked around there by not declaring the (vestigial) empty-string defaults. Likely a if (default) / falsy check in the expected-schema default handling that should be default !== undefined.
Problem
An empty-string column default (
@default: "") is handled inconsistently between codegen and the migrate/verify path on sqlite/d1:.default("")— keeps it.buildExpectedSchema/ the diff appears to DROP the empty-string default (treats""as absent), someta verify --dialect d1reports the column as drift against a DB that hasDEFAULT '', andmeta migratewon't reconcile it.Non-empty defaults (
0,'abstains','[]') round-trip fine; only the empty string is dropped — a classic falsy-""bug.Repro
Model a
field.string @default: ""on an entity, generate + apply to sqlite/d1 (column getsDEFAULT ''), thenmeta verify --dialect d1→ the column reportschange-column-defaultdrift even though metadata and DB agree.Impact
A consumer either can't declare an empty-string default (it perpetually drifts) or gets a codegen-vs-migrate disagreement (Drizzle says
.default(""), the DB rebuild drops it). Surfaced while reconciling a reference-impl's D1 schema; worked around there by not declaring the (vestigial) empty-string defaults. Likely aif (default)/ falsy check in the expected-schema default handling that should bedefault !== undefined.