D1 migrations deployment#11
Merged
Merged
Conversation
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 Agent can help with this pull request. Just |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Cloudflare D1 migration application to the CI deploy workflow and update
wrangler-env.tsto use the localwranglerbinary 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
wranglerCLI was not globally available. Documentation for theCLOUDFLARE_API_TOKENhas also been updated to reflect the necessary D1 edit permissions.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
maindeploys but affects live infrastructure.Overview
Ensures production deployments apply Cloudflare D1 schema changes by adding a
d1 migrations apply ... --remotestep to themaindeploy job before Workers deployment.Updates
wrangler-env.tsto prefer the project-localnode_modules/.bin/wrangler(with fallback toBun.which) to avoid CI failures whenwranglerisn’t globally available. Docs now clarify thatCLOUDFLARE_API_TOKENneeds 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.