Skip to content

fix: align root write context schema metadata - #276

Merged
Joncallim merged 11 commits into
codex/pr198-ordinary-app-trigger-inputsfrom
codex/pr198-root-write-context-metadata
Jul 27, 2026
Merged

fix: align root write context schema metadata#276
Joncallim merged 11 commits into
codex/pr198-ordinary-app-trigger-inputsfrom
codex/pr198-root-write-context-metadata

Conversation

@Joncallim

Copy link
Copy Markdown
Owner

Scope

Aligns the protected write-context table’s physical PostgreSQL metadata with its Drizzle declaration.

  • Names the primary key, unique constraint, positive-value checks, and foreign keys explicitly and identically on both sides.
  • Preserves pg_catalog.clock_timestamp() for entered_at; Drizzle now expresses the same wall-clock default rather than now() / transaction-start time.
  • Adds a focused parity contract covering default, constraints, foreign keys, and restrict deletes.

Compatibility

Migration 0027 is unshipped in this stack, so the corrected DDL applies directly on fresh and populated upgrade paths; no applied-database constraint rename is needed. No constraints are dropped or rebuilt.

Validation

  • PostgreSQL 16 temporary, rolled-back catalog probe confirmed the prior generated names and clock_timestamp() default
  • npm test -- --run __tests__/project-root-reconciliation.test.ts (21 passed)
  • npm test (1,630 passed, 19 skipped)
  • npx eslint --max-warnings=0 db/schema.ts __tests__/project-root-reconciliation.test.ts
  • npx tsc --noEmit
  • npm run build
  • git diff --check

@Joncallim
Joncallim marked this pull request as ready for review July 27, 2026 21:07
@Joncallim
Joncallim merged commit 99ca55b into codex/pr198-ordinary-app-trigger-inputs Jul 27, 2026
2 of 3 checks passed
@Joncallim
Joncallim deleted the codex/pr198-root-write-context-metadata branch August 2, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant