fix(d1): allow remote d1 migrations when id is not specified#12810
Open
Lp-Francois wants to merge 2 commits intocloudflare:mainfrom
Open
Conversation
perform a look up when ID is missing to allow running migrations when the DB is auto-generated from the wrangler file issue cloudflare#12809
🦋 Changeset detectedLatest commit: 99e85d6 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
alsuren
reviewed
Mar 9, 2026
| }); | ||
| if ( | ||
| dbFromConfig?.uuid !== undefined && | ||
| dbFromConfig.uuid !== dbFromConfig.binding |
Contributor
There was a problem hiding this comment.
I'm a bit confused by this. Why are we testing for .uuid != .binding?
Oh: getDatabaseInfoFromConfig() does some nonsense where it returns the db binding.
This is going to be fragile when we implement #11870. Can we parse the uuid to validate that it is a uuid instead?
Contributor
|
I agree with this change in general (as long as there are no objections from the wrangler team). One tiny comment an then let's get it in. |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
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.
Fixes #12809
Describe your change...
allow remote d1 migrations when id is not specified.
Perform a look up when ID is missing to allow running migrations when the DB is auto-provisioned from the wrangler file.
See the issue for more context (I couldn't run the remote migration if the ID is not specified in the wrangler.jsonc file.)
A picture of a cute animal (not mandatory, but encouraged)