Skip to content

D1 migrations deployment#11

Merged
kentcdodds merged 4 commits into
mainfrom
cursor/d1-migrations-deployment-3528
Feb 7, 2026
Merged

D1 migrations deployment#11
kentcdodds merged 4 commits into
mainfrom
cursor/d1-migrations-deployment-3528

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Feb 7, 2026

Copy link
Copy Markdown
Member

Add Cloudflare D1 migration application to the CI deploy workflow and update wrangler-env.ts to use the local wrangler binary to prevent "no such table" and "wrangler not found" errors in production.

This change ensures D1 migrations are applied during deployment to prevent schema-related errors and addresses CI failures where the wrangler CLI was not globally available. Documentation for the CLOUDFLARE_API_TOKEN has also been updated to reflect the necessary D1 edit permissions.


Open in Cursor Open in Web


Note

Medium Risk
Changes the production deploy pipeline to run remote D1 migrations, which can fail or apply incorrect schema if misconfigured. Behavior is limited to main deploys but affects live infrastructure.

Overview
Ensures production deployments apply Cloudflare D1 schema changes by adding a d1 migrations apply ... --remote step to the main deploy job before Workers deployment.

Updates wrangler-env.ts to prefer the project-local node_modules/.bin/wrangler (with fallback to Bun.which) to avoid CI failures when wrangler isn’t globally available. Docs now clarify that CLOUDFLARE_API_TOKEN needs D1 edit permissions in addition to Workers deploy access.

Written by Cursor Bugbot for commit 13491f0. This will update automatically on new commits. Configure here.

cursoragent and others added 4 commits February 7, 2026 07:36
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@cursor

cursor Bot commented Feb 7, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@kentcdodds kentcdodds marked this pull request as ready for review February 7, 2026 07:52
@kentcdodds kentcdodds merged commit 304f819 into main Feb 7, 2026
7 checks passed
@kody-bot kody-bot deleted the cursor/d1-migrations-deployment-3528 branch March 24, 2026 21:05
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.

2 participants