René's URL Explorer Experiment


Title: feat(webapp): CI guard for unindexed onDelete cascade FK columns by ericallam · Pull Request #4618 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: feat(webapp): CI guard for unindexed onDelete cascade FK columns by ericallam · Pull Request #4618 · triggerdotdev/trigger.dev

X Title: feat(webapp): CI guard for unindexed onDelete cascade FK columns by ericallam · Pull Request #4618 · triggerdotdev/trigger.dev

Description: What A relation with onDelete: Cascade | SetNull whose child FK column has no index makes every parent delete fire a cascade that sequentially scans the whole child table. That has shipped three times recently and had to be fixed after the fact (#4554 ProjectAlert.channelId, #4555 EnvironmentVariableValue.valueReferenceId, #4588 PersonalAccessToken.userId). This adds a schema-aware CI guard that catches the next one before it merges. How apps/webapp/scripts/fkCascadeIndexGuard.ts parses both Prisma schemas (@trigger.dev/database, @internal/run-ops-database) and flags any onDelete: Cascade | SetNull relation whose leading FK scalar is not the leading column of some index (@@index / @@unique / @@id / field-level @id/@unique) on the child model. A leading FK column lets the cascade's WHERE fk = $1 use the index instead of a seq scan. It is modeled on the existing runOpsLegacyGuard (same --check gate, same baseline-regenerate pattern), and it is lighter: it only reads schema.prisma as text, so its CI job needs no Prisma client generation and no raised heap. Why a baseline, not a hard rule Not every unindexed cascade FK is a live bug. When the parent is only ever soft-deleted, the cascade never fires, so the missing index is harmless. Hard vs soft delete lives in application code (parent.delete() vs parent.update({ deletedAt })), not in the schema, and a deletedAt column proves neither direction. So the guard makes no such judgment: it flags every unindexed cascade FK uniformly and carries a baseline of the 72 currently-accepted cases. Only violations not in the baseline fail --check. The value is the forcing function: a newly added cascade FK stops CI and makes the author answer "is the parent ever hard-deleted?" Add the index if yes; regenerate the baseline with a reason if no. Wiring apps/webapp/package.json: guard:fk-cascade-index script (regenerate with no args, gate with -- --check). .github/workflows/fk-cascade-guard.yml: the reusable workflow. .github/workflows/pr_checks.yml: runs on webapp-affecting changes, aggregated into all-checks. Verification The three already-fixed columns are correctly seen as indexed (absent from the baseline). --check passes on the current schemas (72 baselined, 0 new). A synthetic new unindexed cascade FK fails with exit 1 and an actionable message. Adding @@index([fk]), or a composite leading with the FK, clears it. No false positives. oxfmt and oxlint clean on the new script. Rollback Pure tooling addition, no runtime code, no schema or data change. Revert to remove.

Open Graph Description: What A relation with onDelete: Cascade | SetNull whose child FK column has no index makes every parent delete fire a cascade that sequentially scans the whole child table. That has shipped three ti...

X Description: What A relation with onDelete: Cascade | SetNull whose child FK column has no index makes every parent delete fire a cascade that sequentially scans the whole child table. That has shipped three ti...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/4618

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:b1d6c64a-2d29-b490-c3dd-8e6c244b96c2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE78A:258059:32A53C1:47E77FA:6AFAF727
html-safe-noncee72ff026ed2d37c67a512f675b04f0c0e27e02b68b366e06f5631a35ab93d1ca
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzhBOjI1ODA1OTozMkE1M0MxOjQ3RTc3RkE6NkFGQUY3MjciLCJ2aXNpdG9yX2lkIjoiNTIwNDI2ODI0MDQ4MjQ0NTE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac527206c1242c32452c3f4fc24ad0123e801c13a740285abde049d1716142f803
hovercard-subject-tagpull_request:4279225596
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/4618/files
twitter:imagehttps://avatars.githubusercontent.com/u/534?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/534?s=400&v=4
og:image:altWhat A relation with onDelete: Cascade | SetNull whose child FK column has no index makes every parent delete fire a cascade that sequentially scans the whole child table. That has shipped three ti...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea85e96a83bed7871993e6b1ffda24105928eee17
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/4618/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4618%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4618%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4618/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4618/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4618/files
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests67 (67)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
ericallamhttps://github.com/ericallam
mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
feat/fk-cascade-index-guardhttps://github.com/triggerdotdev/trigger.dev/tree/feat/fk-cascade-index-guard
Conversation 19 https://github.com/triggerdotdev/trigger.dev/pull/4618
Commits 4 https://github.com/triggerdotdev/trigger.dev/pull/4618/commits
Checks 60 https://github.com/triggerdotdev/trigger.dev/pull/4618/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/4618/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4618/files
feat(webapp): CI guard for unindexed onDelete cascade FK columns https://github.com/triggerdotdev/trigger.dev/pull/4618/files#top
Show all changes 4 commits https://github.com/triggerdotdev/trigger.dev/pull/4618/files
09f4083 feat(webapp): CI guard for unindexed onDelete cascade FK columns ericallam Aug 14, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4618/commits/09f4083097b01ec98b0caf34473b35795dfa8449
78a214d fix(fk-cascade-guard): parse multiline relations, fingerprint baselin… ericallam Aug 14, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4618/commits/78a214d090b502d01c9fd69bd4b355abc4b9ac0a
02a93d4 fix(fk-cascade-guard): quote-aware schema parsing + stricter baseline… ericallam Aug 14, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4618/commits/02a93d4ca49eb250255f85c5daa41c54a8883fea
fe12850 fix(fk-cascade-guard): fail --check on stale baseline entries to prev… ericallam Aug 14, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4618/commits/fe128502eb01b043adf7d0a10780aadd3f4242f2
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/4618/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4618/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4618/files
fk-cascade-guard.yml https://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-46f6cf87e0fae20589e6b2c421cdfd4fe26fe35beccc24838c48469311e80fd5
pr_checks.yml https://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-7fd48d2bcafcb3c7d6682c8358e3f8d1ed85c841d6f63d5e63c19a93e157608f
package.json https://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-7f07c1a8c7d8bf8a62c48e4913ae22619918c9d72fc3b12aa75aa5c03217612b
fk-cascade-index-baseline.json https://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-6fe6c092d064b930f142248b4ee1ed67b0957c4dc6a16226048d6e1fb83aaf15
fkCascadeIndexGuard.ts https://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-c6db931ce0e81ac6bfae5d1d6102f1a2803ab6f00519f30571642e8825efd05f
.github/workflows/fk-cascade-guard.ymlhttps://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-46f6cf87e0fae20589e6b2c421cdfd4fe26fe35beccc24838c48469311e80fd5
View file https://github.com/triggerdotdev/trigger.dev/blob/fe128502eb01b043adf7d0a10780aadd3f4242f2/.github/workflows/fk-cascade-guard.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4618/{{ revealButtonHref }}
.github/workflows/pr_checks.ymlhttps://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-7fd48d2bcafcb3c7d6682c8358e3f8d1ed85c841d6f63d5e63c19a93e157608f
View file https://github.com/triggerdotdev/trigger.dev/blob/fe128502eb01b043adf7d0a10780aadd3f4242f2/.github/workflows/pr_checks.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4618/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-7fd48d2bcafcb3c7d6682c8358e3f8d1ed85c841d6f63d5e63c19a93e157608f
https://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-7fd48d2bcafcb3c7d6682c8358e3f8d1ed85c841d6f63d5e63c19a93e157608f
https://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-7fd48d2bcafcb3c7d6682c8358e3f8d1ed85c841d6f63d5e63c19a93e157608f
https://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-7fd48d2bcafcb3c7d6682c8358e3f8d1ed85c841d6f63d5e63c19a93e157608f
https://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-7fd48d2bcafcb3c7d6682c8358e3f8d1ed85c841d6f63d5e63c19a93e157608f
https://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-7fd48d2bcafcb3c7d6682c8358e3f8d1ed85c841d6f63d5e63c19a93e157608f
apps/webapp/package.jsonhttps://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-7f07c1a8c7d8bf8a62c48e4913ae22619918c9d72fc3b12aa75aa5c03217612b
View file https://github.com/triggerdotdev/trigger.dev/blob/fe128502eb01b043adf7d0a10780aadd3f4242f2/apps/webapp/package.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4618/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-7f07c1a8c7d8bf8a62c48e4913ae22619918c9d72fc3b12aa75aa5c03217612b
https://github.com/triggerdotdev/trigger.dev/pull/4618/files#diff-7f07c1a8c7d8bf8a62c48e4913ae22619918c9d72fc3b12aa75aa5c03217612b
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4618/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.