feat(OUT-3697): index workspaceId and parentId on Tasks#1206
feat(OUT-3697): index workspaceId and parentId on Tasks#1206priosshrsth wants to merge 4 commits intomainfrom
Conversation
- add @@index for workspaceId and parentId in Task schema (named IX_Tasks_workspaceId, IX_Tasks_parentId) - new Prisma migration uses CREATE INDEX IF NOT EXISTS so it is a no-op in prod once the indexes are created CONCURRENTLY via the Supabase SQL editor; lower environments build them normally - bundled unrelated local updates: bun + node 24 in mise.toml, next.config.js -> next.config.ts rename, sentry/next/react bumps in package.json + yarn.lock, supabase studio query snippet Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR adds B-tree indexes on
Confidence Score: 4/5Safe to merge once the CONCURRENTLY indexes are confirmed in production; no logic changes touch application code. The migration and schema changes are straightforward and low-risk. The two minor issues — non-deterministic bun = latest and the module.exports leftover in a .ts file — won't break the build but are worth cleaning up before they cause confusion. mise.toml (unpinned Bun version) and next.config.ts (module.exports vs export default); the migration SQL and Prisma schema are clean. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[PR merged / prisma migrate deploy] --> B{Index already exists?}
B -- Yes\n(production: pre-built CONCURRENTLY) --> C[CREATE INDEX IF NOT EXISTS\nis a no-op]
B -- No\n(staging / local) --> D[CREATE INDEX runs\nnormally]
C --> E[Migration recorded in _prisma_migrations]
D --> E
|
…-3697-index-workspaceid-column-in-tasks-table
Keep this PR focused on the Tasks index work — reverting next.config.ts rename, @sentry/nextjs / next / react bumps, and removing the Supabase Studio query snippet. mise.toml updates (bun, node 24, dev/db tasks) intentionally retained. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Deployment failed with the following error: Learn More: https://vercel.link/multiple-function-regions |
Summary
Tasks.workspaceIdandTasks.parentIdto drop a 7s query by ~99% (per Supabase analysis on the Linear ticket).CREATE INDEX IF NOT EXISTSso it's a no-op in production — indexes will be built ahead of deploy viaCREATE INDEX CONCURRENTLYin the Supabase SQL editor to avoid locking writes. Lower envs build them normally.Production rollout (must run BEFORE merging/deploy)
In the Supabase SQL editor, run each statement individually (CONCURRENTLY cannot run inside a transaction):
Verify:
Once both indexes exist in prod, the Prisma migration becomes a no-op there and just gets recorded in
_prisma_migrations.Test plan
pg_indexesquery above)prisma migrate deployruns cleanly on staging🤖 Generated with Claude Code