Skip to content

feat(migrations)!: ship migrations as SQL with Interchange's signature - #8

Merged
TheGreatAxios merged 1 commit into
cl-9195-agent-token-trim-barrel-to-public-apifrom
cl-9218-agent-token-align-migrations-to-runmigrationsconfig-schema
Sep 27, 2026
Merged

TheGreatAxios merged 1 commit into
cl-9195-agent-token-trim-barrel-to-public-apifrom
cl-9218-agent-token-align-migrations-to-runmigrationsconfig-schema

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • DDL lives in migrations/0001_agent_token.sql (drizzle breakpoint format) and ships in the tarball.
  • runAgentTokenMigrations(dbConfig, { schema }) replaces applyAgentTokenMigrations(databaseUrl, { tenantSchema }). schema is the host schema holding Interchange's tenant table (the value passed to runMigrations); tables stay in agent_token with the FK rewritten to <schema>.tenant. An empty schema or missing SQL throws, as in Interchange.
  • Migrations run in one advisory-locked transaction.
  • No runtime DBConfig validation: @intx/db 0.4.0 exports DBConfig as a type only.
  • Breaking for workbench apps/hub/src/migrate.ts, which calls applyAgentTokenMigrations.
  • Stacked on refactor!: export only the public API from the package root #7.

Verification

  • bun install --frozen-lockfile, bun run typecheck, bun run build: pass
  • DB suite against local Postgres (DATABASE_URL=... bun test --timeout 60000 ./src): 7 pass, 0 fail
  • npm pack --dry-run lists the SQL; the built dist/migrations.js migrates under plain Node.

Closes CL-9218

@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: diff matches the linked ticket(s); independent review passes addressed (fixed or waived as noted in the description); typecheck, build and the Postgres-backed suite pass on this branch.

@TheGreatAxios
TheGreatAxios force-pushed the cl-9218-agent-token-align-migrations-to-runmigrationsconfig-schema branch from d2da582 to dcd4a1c Compare September 25, 2026 18:09
@TheGreatAxios
TheGreatAxios force-pushed the cl-9218-agent-token-align-migrations-to-runmigrationsconfig-schema branch 2 times, most recently from 5063ff2 to aedff2d Compare September 25, 2026 23:49
@TheGreatAxios
TheGreatAxios force-pushed the cl-9218-agent-token-align-migrations-to-runmigrationsconfig-schema branch from aedff2d to 8e34bdf Compare September 25, 2026 23:53
@TheGreatAxios TheGreatAxios changed the title Ship agent-token migrations as SQL with Interchange's signature feat(migrations)!: ship migrations as SQL with Interchange's signature Sep 26, 2026
@TheGreatAxios
TheGreatAxios force-pushed the cl-9218-agent-token-align-migrations-to-runmigrationsconfig-schema branch from 8e34bdf to 4fc3398 Compare September 26, 2026 01:27
@TheGreatAxios
TheGreatAxios force-pushed the cl-9218-agent-token-align-migrations-to-runmigrationsconfig-schema branch from 4fc3398 to 4ce4318 Compare September 26, 2026 01:37
@TheGreatAxios
TheGreatAxios added this pull request to stack #12 September 26, 2026 01:58
Hosts call runAgentTokenMigrations(config, { schema }) with the same
config and schema they pass Interchange's runMigrations.
@TheGreatAxios
TheGreatAxios force-pushed the cl-9218-agent-token-align-migrations-to-runmigrationsconfig-schema branch from 4ce4318 to 273dc04 Compare September 27, 2026 01:00
@TheGreatAxios
TheGreatAxios removed this pull request from stack #12 September 27, 2026 01:42
@TheGreatAxios
TheGreatAxios added this pull request to stack #17 September 27, 2026 01:43
@TheGreatAxios
TheGreatAxios merged commit 343c1c8 into main Sep 27, 2026
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