wrangler.toml config questions
Hi there!
I just wanted to make sure that I setup my workers / understood how the wrangler.toml config actually works.
Here is my current config:
1. No "name" at top level
Since I didn't provide a name at the top level, I will always deploy my workers with the -e flag - same goes for migrations.
This way I don't end up with a top level worker, but only get "api-staging" and "api-production"
2. [[d1_databases]] - last one in the config
This is used for the local dev wrangler if I'm not mistaken - but how exactly?
Currently I just copied whatever I have in the config for the staging environment - but this doesn't "point" to that worker/d1 instance, does it?
I could literally change everything for this last config and just fix my scripts accordingly.
So for example if I change the database_name to "this_is_random"
then my local migration script would look something like:
migrate:local": "wrangler d1 migrations apply this_is_random --local
2 Replies
3. how to sync staging and local
I want to keep my local and staging environment in sync when developing. Is it possible to dump the staging data? Does anyone have a suggestion how to obtain this in the best way?
So far my pipelines are going to run the migrations and deploy the workers depending on merge to staging or production branch, but I also want to be able to pull the staging environment into my local environment
To answer this 3rd question myself, I guess for now you can create a backup using of the desired environment using this and just seed from that locally?
reference: https://github.com/cloudflare/workers-sdk/issues/3891