Skip to content

Commit d98f1dd

Browse files
committed
[wrangler/d1] Address PR comment suggestions
1 parent d8a267a commit d98f1dd

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

.changeset/auto-apply-migrations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
"wrangler": patch
2+
"wrangler": minor
33
---
44

55
Add a new `--force` flag to `d1 migrations apply` which skips the interactive

packages/wrangler/src/__tests__/d1/migrate.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { msw } from "../helpers/msw";
1212
import { runInTempDir } from "../helpers/run-in-tmp";
1313
import { runWrangler } from "../helpers/run-wrangler";
1414

15-
1615
describe("migrate", () => {
1716
runInTempDir();
1817
const mockStd = mockConsoleMethods();
@@ -230,7 +229,7 @@ Your database may not be available to serve requests during the migration, conti
230229
expect(std.out).toBe("");
231230
});
232231

233-
it("applies migrations from a migration directory containing .sql files", async () => {
232+
it("applies migrations from a migration directory containing .sql files", async ( { expect }) => {
234233
setIsTTY(false);
235234
const commands: string[] = [];
236235

@@ -312,7 +311,7 @@ Your database may not be available to serve requests during the migration, conti
312311
);
313312
});
314313

315-
it("should not prompt when --force is passed", async () => {
314+
it("should not prompt when --force is passed", async ({ expect }) => {
316315
setIsTTY(false);
317316
const std = mockConsoleMethods();
318317

packages/wrangler/src/d1/migrations/apply.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { getDatabaseInfoFromConfig } from "../utils";
1313
import { getMigrationsPath, getUnappliedMigrations, initMigrationsTable } from "./helpers";
1414
import type { ParseError } from "@cloudflare/workers-utils";
1515

16-
1716
export const d1MigrationsApplyCommand = createCommand({
1817
metadata: {
1918
description: "Apply any unapplied D1 migrations",
@@ -67,6 +66,7 @@ export const d1MigrationsApplyCommand = createCommand({
6766
type: "boolean",
6867
description: "Automatically apply all pending migrations without prompt",
6968
default: false,
69+
alias: "y",
7070
},
7171
},
7272
positionalArgs: ["database"],

0 commit comments

Comments
 (0)