Repository navigation
Support D1 migrations directory and upload_source_maps in cloudflare.config.ts #648
workers-devprod
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Moved from #609. Originally opened by thedavidweng on 2026-10-01.
Problem
cloudflare.config.tscannot express two Wrangler settings that real projects still depend on, sowrangler.jsonccannot be removed aftercf migrate, even thoughcf devandcf deploywork fromcloudflare.config.ts.Checked against
cf@1.0.0-beta.10and@cloudflare/config@0.22.0.1. D1 migrations directory
Wrangler reads
migrations_dirfrom eachd1_databasesentry.D1BindingOptionsin@cloudflare/configonly hasid,nameanddev, so there is no equivalent.cf migratetherefore drops it.cf d1 migrations applyhas--dir,--patternand--table, but the directory has to be passed on every call, and the database has to be given by ID rather than by binding name (see #38).Example project: two D1 bindings with different migration directories (
migrations/controland../../packages/database-d1/migrations), across local, staging and production. With flags only, the mapping from database to directory lives in sixpackage.jsonscripts instead of next to the binding. A wrong--dirapplies the wrong schema to a database.2.
upload_source_mapsupload_source_mapshas no counterpart in the Worker config. I could not findsourcemapor similar in the public config types.Proposed behavior
migrationsoption (dir, and ideallypatternandtable) tobindings.d1(), mirroringmigrations_dir,migrations_patternandmigrations_tablein Wrangler.cf d1 migrations apply|list|createuse it when the database is resolved from project config (together with Allow commands to resolve resources by binding name #38), so no--diris needed.cf migratecarry these across. Until then, report them as unmigrated rather than printingMigration complete.(see cf migrate: carry config comments across, or report the ones it drops workers-sdk#16121 for the same silent-loss problem with comments).Related
--persist-toignored bycf dev, and--localcommands default to a different state directory than Wranglercf d1 migrations apply --localdoes not exit while stdin is an open non-TTY pipe #64 hangs incf d1 migrations apply --localcf migratedrops comments without reporting itI searched this repository for
migrations_dirandupload_source_mapsand found no existing issue or PR.workers-devprod commented on 2026-10-07:
Automated triage
Issue assessment
enhancement(high)product:d1(high)package:config(high)product:deploy-config(medium)Actionability and missing information
Feature request: cloudflare.config.ts (config package 0.22.0, cf 1.0.0-beta.10) lacks D1 migrations dir/pattern/table options on bindings.d1() and a Worker-level upload_source_maps option; reporter asks for both, for cf d1 migrations to use them, and for cf migrate to carry or report them.
Reproduction reason: Feature request for missing config options; no current behavior defect to reproduce.
This summary was generated by an LLM and may contain errors. Please verify its findings.
Triage bot commands and options
Repository collaborators with write or admin access can trigger actions by commenting on this issue:
@workers-devprod reproduce: Attempt to reproduce the issue using its description and recent comments.All reactions