Repository navigation
fix(schema): a NOT NULL column with a declared default is additive (#904) - #905
Merged
Merged
Conversation
4 tasks
) The deploy gate (er-server migrate --expect-additive) plans live-vs-catalog before any fixup runs, and the differ classified EVERY missing NOT NULL column as breaking — so #805's tags.kind (NOT NULL DEFAULT 'user') refused the schema-migrate hook and the release rolled back. The design table in entity-framework-design.md always said 'refused WITHOUT a default'; the code now matches: with a default declared, the add is Safe on Postgres, and add_column_sql emits both clauses (NOT NULL DEFAULT) so the old release's column-named INSERTs keep working underneath the deploy.
athvin
force-pushed
the
fix/904-not-null-default
branch
from
November 8, 2026 20:10
7ac39bb to
11ad2c9
Compare
athvin
marked this pull request as ready for review
November 8, 2026 20:18
This was referenced Nov 8, 2026
Reconciler-added columns never get their CHECK constraints — healed stores drift from fresh DDL
#914
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #904
What
Treat a missing Postgres NOT NULL column with a declared default as additive, and include NOT NULL plus DEFAULT in the generated ADD COLUMN statement. Columns without defaults remain breaking changes.
Why
The schema pre-upgrade hook rejected the tags.kind column introduced by #875 before the repair fixup could run, blocking deployment. This change aligns classification and emitted SQL with the documented additive rule.
Proof
Rust CI run 42520403802 passed on merge 85de695; images run 42520403886 and deploy run 42520861582 passed. The merge remains an ancestor of origin/main.
Risk & rollback
Scoped to missing Postgres columns with declared defaults. Reverting restores the prior refusal and could block deployments requiring such a column.
Post-merge ledger
Closed by: Codex · session
01a1be1b-0c92-7703-a4c2-25cb2c999baaonMac.lan· 2026-11-09T02:39:32.358258+00:00er-server listeningat 2026-11-09T02:19:13Z (observed during session recovery), with the schema fix still in main.Context — recovered evidence
This PR's body was empty when recovering Codex session 01a1b892-4cde-7a53-bb3e-9ed2e764acdc. This record was reconstructed from issue #904, the merge and workflow records, issue #914, ancestry, board automation, and observed descendant process logs. The recovered session recorded an aged-store reproduction; this recovery did not rerun that local test or alter the code.