Skip to content

feat(migrations)!: runMailboxMigrations(config, { schema }) - #40

Merged
TheGreatAxios merged 1 commit into
cl-9325-mailbox-add-shared-real-postgres-test-harness-in-testsfrom
cl-9239-mailbox-align-runmailboxmigrations-to-runmigrationsconfig
Sep 27, 2026
Merged

TheGreatAxios merged 1 commit into
cl-9325-mailbox-add-shared-real-postgres-test-harness-in-testsfrom
cl-9239-mailbox-align-runmailboxmigrations-to-runmigrationsconfig

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Stacked on test: real-Postgres harness and an HTTP send-and-read e2e #39.
  • runMailboxMigrations(config: DBConfig, { schema }) takes the same arguments as Interchange's runMigrations; the (db) signature is removed.
  • schema is the host schema holding tenant/principal; the mailbox FKs are rewritten to it. Mailbox tables stay in the mailbox schema. Same convention as corbits-cron.
  • Ledger checksums hash statements as shipped, so they are independent of the host schema.
  • @intx/db ^0.4.0 is a new peer; createMailboxDb is no longer exported. README quickstart uses createDB and passes schema: "public".

Verification

A new test migrates into a non-public host schema and asserts the FKs target it; another rejects an empty schema. The README quickstart compiles under tsc --strict. CI is green on this branch: install --frozen-lockfile, build, typecheck, tests against Postgres, and the Node consumer smoke test.

Closes CL-9239

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review: an independent review pass found no correctness bugs; its doc and public-surface findings are fixed (stale JSDoc, createMailboxDb export dropped, wrapping, FK-move note). Build, typecheck and 173 tests pass.

@TheGreatAxios
TheGreatAxios force-pushed the cl-9239-mailbox-align-runmailboxmigrations-to-runmigrationsconfig branch from eace332 to a9a2a77 Compare September 25, 2026 15:02
@TheGreatAxios
TheGreatAxios force-pushed the cl-9239-mailbox-align-runmailboxmigrations-to-runmigrationsconfig branch from a9a2a77 to 0b6b844 Compare September 25, 2026 17:52
@TheGreatAxios
TheGreatAxios force-pushed the cl-9239-mailbox-align-runmailboxmigrations-to-runmigrationsconfig branch from 0b6b844 to 899ea82 Compare September 26, 2026 01:28
@TheGreatAxios TheGreatAxios changed the title feat(migrations): runMailboxMigrations(config, { schema }) feat(migrations)!: runMailboxMigrations(config, { schema }) Sep 26, 2026
@TheGreatAxios
TheGreatAxios added this pull request to stack #47 September 26, 2026 01:58
The runner takes the same arguments a host passes Interchange's
runMigrations: a DBConfig and the host schema holding tenant and
principal. The mailbox FKs point at that schema; the mailbox tables stay
in the mailbox schema, and ledger checksums hash the statements as
shipped so they do not depend on the host schema. createMailboxDb is no
longer exported; it moves into the test helpers.

Closes CL-9239.
@TheGreatAxios
TheGreatAxios force-pushed the cl-9239-mailbox-align-runmailboxmigrations-to-runmigrationsconfig branch from 899ea82 to 13dbe3d Compare September 26, 2026 02:40
@TheGreatAxios
TheGreatAxios removed this pull request from stack #47 September 26, 2026 02:40
@TheGreatAxios
TheGreatAxios added this pull request to stack #50 September 26, 2026 02:40
@TheGreatAxios
TheGreatAxios merged commit 35ab024 into main Sep 27, 2026
2 checks passed
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