Skip to content

Commit eb8a415

Browse files
authored
fix(wrangler): Update missing DO migrations message to recommend new_sqlite_classes (#12189)
* Updated missing migrations message to recommend `new_sqlite_classes` instead of `new_classes` * Updated tests to account for new migrations warning message * Fixed minor inline test snapshot contents * Added changeset
1 parent 3ee4fa6 commit eb8a415

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

.changeset/angry-streets-do.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Fixed Durable Object missing migrations warning message.
6+
7+
If a Workers project includes some `durable_objects` in it but no `migrations` we show a warning to the user to add `migrations` to their config. However, this warning recommended `new_classes` for their migrations, but we instead now recommend all users use `new_sqlite_classes` instead.

packages/workers-utils/src/config/validation.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4841,7 +4841,9 @@ function warnIfDurableObjectsHaveNoMigrations(
48414841
\`\`\`
48424842
${formatConfigSnippet(
48434843
{
4844-
migrations: [{ tag: "v1", new_classes: durableObjectClassnames }],
4844+
migrations: [
4845+
{ tag: "v1", new_sqlite_classes: durableObjectClassnames },
4846+
],
48454847
},
48464848
configPath
48474849
)}

packages/workers-utils/tests/config/validation/normalize-and-validate-config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ describe("normalizeAndValidateConfig()", () => {
10551055
\`\`\`
10561056
[[migrations]]
10571057
tag = \\"v1\\"
1058-
new_classes = [ \\"CLASS1\\" ]
1058+
new_sqlite_classes = [ \\"CLASS1\\" ]
10591059
10601060
\`\`\`
10611061

packages/wrangler/src/__tests__/deploy.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8351,7 +8351,7 @@ addEventListener('fetch', event => {});`
83518351
\`\`\`
83528352
[[migrations]]
83538353
tag = \\"v1\\"
8354-
new_classes = [ \\"SomeClass\\" ]
8354+
new_sqlite_classes = [ \\"SomeClass\\" ]
83558355

83568356
\`\`\`
83578357

packages/wrangler/src/__tests__/dev.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ describe.sequential("wrangler dev", () => {
15811581
\`\`\`
15821582
[[migrations]]
15831583
tag = \\"v1\\"
1584-
new_classes = [ \\"CLASS_1\\", \\"CLASS_3\\" ]
1584+
new_sqlite_classes = [ \\"CLASS_1\\", \\"CLASS_3\\" ]
15851585
15861586
\`\`\`
15871587

0 commit comments

Comments
 (0)