Skip to content

Commit 1a2034d

Browse files
committed
Adding more detail, addressing VT feedback.
1 parent 459c181 commit 1a2034d

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

src/content/docs/durable-objects/reference/durable-objects-migrations.mdx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,24 @@ transferred_classes = [{from = "DurableObjectExample", from_script = "OldWorkerS
271271

272272
- The migration list is an ordered array of tables, specified as a key in your Wrangler configuration file. You can define the migration for each environment, as well as at the top level.
273273

274-
- If a migration is only specified at the top-level, but not at the environment-level, the environment will inherit the top-level migration.
275-
276-
- Migrations at at the environment-level can override migrations at the top level.
274+
- You can define the migration for each environment, as well as at the top level.
275+
- Top-level migration is specified at the top-level `migrations` key in the Wrangler configuration file.
276+
- Environment-level migration is specified by a `migrations` key inside the `env` key of the Wrangler configuration file (`[env.<environment_name>.migrations]`).
277+
- Example Wrangler file:
278+
```jsonc title="wrangler.jsonc"
279+
{
280+
// top-level default migrations
281+
"migrations": [{ ... }],
282+
"env": {
283+
"staging": {
284+
// migration override for staging
285+
"migrations": [{...}]
286+
}
287+
}
288+
}
289+
```
290+
- If a migration is only specified at the top-level, but not at the environment-level, the environment will inherit the top-level migration.
291+
- Migrations at at the environment-level override migrations at the top level.
277292

278293
- All migrations are applied at deployment. Each migration can only be applied once per [environment](/durable-objects/reference/environments/).
279294

src/content/docs/durable-objects/reference/environments.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ durable_objects.bindings = [
6161

6262
</WranglerConfig>
6363

64+
### Migration environments
65+
66+
You can define a Durable Object migration for each environment, as well as at the top level. Migrations at at the environment-level override migrations at the top level.
67+
68+
For more information, refer to [Migration Wrangler Configuration](/durable-objects/reference/durable-objects-migrations/#migration-wrangler-configuration).
69+
6470
## Local development
6571

6672
Local development sessions create a standalone, local-only environment that mirrors the production environment, so that you can test your Worker and Durable Objects before you deploy to production.

0 commit comments

Comments
 (0)