[wrangler] Fix nested D1 migrations#13913
Conversation
🦋 Changeset detectedLatest commit: 873f35c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
NuroDev
left a comment
There was a problem hiding this comment.
Great little fix. Thank you @swalker326!
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
|
A little concerned that this may break existing flows |
Nested directories are not required, they're just supported with this PR. You can put top level *.sql files OR folders with *.sql files in them. For your setup you would see no change, continue to copy the sql files over. |
Head branch was pushed to by a user without write access
Fixes #13257.
Fix D1 migration discovery so
wrangler d1 migrations listandwrangler d1 migrations applyrecursively include nested.sqlfiles undermigrations_dir. Nested migrations are recorded using relative paths, andwrangler d1 migrations createnow accounts for nested numeric prefixes when choosing the next migration number.A picture of a cute animal (not mandatory, but encouraged)