@@ -7,6 +7,82 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
77
88## [ Unreleased]
99
10+ ## [ 0.21.2] — npm ` 0.21.2 ` · PyPI ` 0.21.2 ` · NuGet ` 0.21.2 ` · Maven ` 7.21.2 `
11+
12+ Coordinated PATCH. ** Changed product code: npm only** (` codegen-ts ` , plus a comment-only note in
13+ ` runtime-ts ` and the ` migrate-ts ` /` cli ` refusal below). PyPI, NuGet and Maven are version-parity
14+ bumps — schema and TypeScript codegen are TS-owned (ADR-0015), so no other port has an analogue.
15+
16+ ### Fixed — ` timestampMode: "date" ` generated code that did not compile
17+
18+ ` timestampMode: "date" ` is the documented opt-in for consumers whose code works with JS ` Date `
19+ rather than ISO strings. Several codegen paths ignored it and emitted string-shaped output, so the
20+ generated Drizzle column was ` Date ` -typed while the stamp and validators produced ` string ` — a hard
21+ compile failure (` TS2322: Type 'string' is not assignable to type 'Date | SQL<unknown>' ` ), cascading
22+ into every generated insert/update query touching the field. Reported by an adopting project.
23+
24+ Five emitters now honor the mode: the ` @autoSet ` ` $defaultFn ` stamp, the three ` @autoSet ` Zod call
25+ sites, and ` zodFieldExpr ` 's general ` field.timestamp ` case — so a ** plain, non-` @autoSet ` ** timestamp
26+ was affected too, not only stamped ones.
27+
28+ Three further defects were caught by a pre-publish review before any of this shipped:
29+
30+ - ** Wire values were rejected.** The Insert/Update schemas validate raw JSON request bodies, where a
31+ timestamp arrives as an ISO string, and ` z.date() ` rejects those outright — date mode would have
32+ gone from * "doesn't compile"* to * "compiles, then 400s every write"* , with React form saves failing
33+ silently. They now emit ` z.coerce.date() ` , which accepts wire strings and ` datetime-local ` values,
34+ passes driver-supplied ` Date ` s through, and still short-circuits ` null ` so a present-null PATCH
35+ clears as FR-035 requires.
36+ - ** sqlite/D1 emitted non-compiling code.** Only the Postgres column mapper honors the mode, so
37+ ` dialect: "sqlite" ` plus date mode produced a ` text ` column with a ` Date ` -returning ` $defaultFn ` .
38+ ` timestampMode ` now normalizes to ` "string" ` for sqlite (which covers D1) at both configuration
39+ choke points, making the option a documented safe no-op there instead of a trap.
40+ - ** Projection and write-through read schemas were missed.** ` zodTypeFor ` hardcoded ` z.string() ` , so
41+ a view-backed entity or projection carrying a timestamp kept the original type cascade. It is now
42+ mode-aware and threads the same options object that types the view column, so the two cannot
43+ diverge again.
44+
45+ ` field.date ` and ` field.time ` deliberately remain string-shaped — Drizzle types both as strings under
46+ every dialect, so they are genuinely not governed by this option. Value-object timestamps are
47+ likewise excluded, since jsonb storage is always ISO string.
48+
49+ ** Known limitation, now surfaced at build time:** filtering a Date-mode timestamp
50+ (` ?filter[field][gte]=… ` ) throws at request time, because the runtime filter parser does not yet
51+ carry the column mode. ` meta gen ` now warns when a ` @filterable ` timestamp is emitted under date
52+ mode, rather than leaving it to fail in production.
53+
54+ Default ` "string" ` mode output is byte-identical — verified by a zero-diff golden corpus.
55+
56+ ### Fixed — ` meta migrate ` refused a destructive drop it could not disambiguate
57+
58+ ` 0.21.1 ` stopped ` meta migrate ` dropping a live Postgres ` serial ` primary key's default during
59+ adoption, but only when the metadata explicitly declared ` @generation: increment ` . An adopter who
60+ declared ` identity.primary ` ** without** ` @generation ` still got the destructive
61+ ` ALTER COLUMN … DROP DEFAULT ` , leaving ` id ` ` NOT NULL ` with nothing to populate it.
62+
63+ Widening the guard was rejected as a fix: an undeclared ` @generation ` is genuinely ambiguous — it may
64+ mean "never declared it" or "removing auto-increment on purpose" — and silently keeping the sequence
65+ would break a deliberate migration off increment. So ` migrate ` now ** refuses** , naming the table, the
66+ column, the live default, the consequence, and both remedies: declare ` @generation: increment ` to
67+ keep the sequence, or pass the new ` --allow drop-identity-default ` if removal is intended. This
68+ follows the same detect-and-refuse precedent as the primary-key-move refusal.
69+
70+ ### Fixed — ` --allow ` tokens were rejected by the config-file schema
71+
72+ Three separate lists of ` --allow ` tokens had drifted: the CLI validator carried eleven, the
73+ ` .metaobjects/config.json ` schema six, and the CLI README eight. A user who set ` adopt-view ` in
74+ ` migrate.allow ` got a schema rejection ** for a flag that has shipped since 0.20.4** . All three are
75+ synced, and a test now pins them together by importing each list rather than restating it.
76+
77+ ### Fixed — the release-tag integration lane was permanently red
78+
79+ The ` migrate-ts-pg ` job had failed on every release tag going back to at least ` v0.20.0 ` — the same
80+ six tests each time — so it provided no signal. Two test-side causes: fixtures declaring an entity
81+ with no ` source.rdb ` child (persistability derives from a declared source, so nothing was created),
82+ and CHECK-expression expectations that predated the normalizer's comma-spacing rule. The suite goes
83+ 124 pass / 6 fail → 130 pass / 0 fail against a real Postgres. Its tag-only trigger is unchanged, so
84+ the lane can still rot unnoticed between releases.
85+
1086## [ 0.21.1] — npm ` 0.21.1 ` · PyPI ` 0.21.1 ` · NuGet ` 0.21.1 ` · Maven ` 7.21.1 `
1187
1288Coordinated PATCH. ** Changed product code: Maven (` metadata ` ) and npm (` migrate-ts ` , plus the
0 commit comments