Skip to content

fix(prisma): support legacy token migration replay#30

Merged
Vann-Dev merged 1 commit into
mainfrom
kaito/verify-legacy-migrations
May 13, 2026
Merged

fix(prisma): support legacy token migration replay#30
Vann-Dev merged 1 commit into
mainfrom
kaito/verify-legacy-migrations

Conversation

@Vann-Dev
Copy link
Copy Markdown
Owner

Summary

  • Make historical token migrations replay on non-empty pre-token AgentBridge databases by adding nullable columns, deterministic placeholder backfills, then restoring NOT NULL constraints.
  • Document post-upgrade operator steps for legacy databases: review generated AgentIds, rotate the company bearer token, and rerun Agent API smoke checks.

Verification

  • Reproduced existing failure on disposable Neon schema seeded with legacy User/Company/Agent/Project/Task rows: 20260508210351_add_bearer_token failed with Null constraint failed: (bearerTokenHash).
  • After the fix, replayed the full migration chain against a new disposable non-empty legacy schema: PASS.
  • corepack pnpm lint
  • DATABASE_URL=postgresql://user:pass@localhost:5432/agentbridge?schema=public AUTH_SECRET=placeholder corepack pnpm typecheck
  • DATABASE_URL=postgresql://user:pass@localhost:5432/agentbridge?schema=public AUTH_SECRET=placeholder corepack pnpm build

Notes: build still emits existing Next.js middleware deprecation and jose Edge Runtime warnings.

@Vann-Dev Vann-Dev merged commit 7766549 into main May 13, 2026
1 check passed
@Vann-Dev Vann-Dev deleted the kaito/verify-legacy-migrations branch May 13, 2026 00:37
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