You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
migrate --expect-additive refuses a NOT NULL column that carries a default — #805's tags.kind can never deploy #904
er-server migrate --expect-additive plans live-store vs catalog before any fixup runs, and er-entity-diff classifies a missing NOT NULL column as Breakingunconditionally:
rust/crates/er-entity-diff/src/lib.rs — "adding a nullable column is safe; a NOT NULL add needs a default (breaking here)".
#805 added tags.kind text NOT NULL DEFAULT 'user', so the dev store's plan is breaking and the gate refuses — correctly, per its rule. The 0005_tag_kind fixup inside ensure_schema never runs because the gate exits first. Every release containing #805 is undeployable until this is fixed.
Repro (exact hook invocation against a store aged to pre-#805):
verdict: breaking (catalog 73637fbf2edd)
1 statement(s) would be applied:
public.tags: ALTER TABLE public.tags ADD COLUMN apply_min_role text;
1 difference(s) the reconciler REFUSES to auto-apply:
public.tags: column kind is absent; add column
EXIT=3
The fix the code already describes
Two comments say the rule was meant to be default-aware: the differ's own "(breaking here)" aside, and ReconcileError::Breaking's doc — "a NOT NULL column added without a default". Make both true: a missing NOT NULL column with a declared default is Safe on Postgres, and add_column_sql emits the full fragment (ADD COLUMN kind text NOT NULL DEFAULT 'user';).
Safety argument (the one 0005_tag_kind's doc already makes): pg ≥ 11 fills existing rows from the default metadata-only; old code's INSERTs name their columns (E011), so the default fills kind for them; old SELECTs enumerate known columns. Control-plane tables are small — the data with volume lives in the lake, not this store — so even a volatile default's rewrite cannot hold the hook past its 600s deadline in practice.
Activity
athvin commentedon Nov 8, 2026
Claimed — working in #905 (draft). Closing that PR releases the claim.
fix(schema): a NOT NULL column with a declared default is additive (#904
fix(schema): a NOT NULL column with a declared default is additive (#904
fix(schema): a NOT NULL column with a declared default is additive (#904