chore(): Accept an extra agument 'all-or-nothing' on the migrate command (#14262)

* chore(): Accept an extra agument 'all-or-nothing' on the migrate command

* Create rich-camels-brush.md

* chore(): Accept an extra agument 'all-or-nothing' on the migrate command

* chore(): Accept an extra agument 'all-or-nothing' on the migrate command

* chore(): Accept an extra agument 'all-or-nothing' on the migrate command

* chore(): fix broken down migrations

* chore(): update changeset
This commit is contained in:
Adrien de Peretti
2025-12-10 09:23:41 +01:00
committed by GitHub
parent 9bcfb990bf
commit 356283c359
13 changed files with 139 additions and 56 deletions

View File

@@ -1,5 +1,5 @@
import { sync as existsSync } from "fs-exists-cached"
import { setTelemetryEnabled } from "@medusajs/telemetry"
import { sync as existsSync } from "fs-exists-cached"
import path from "path"
import resolveCwd from "resolve-cwd"
import { newStarter } from "./commands/new"
@@ -200,6 +200,12 @@ function buildLocalCommands(cli, isLocalProject) {
type: "number",
describe: "Number of concurrent migrations to run",
})
builder.option("all-or-nothing", {
type: "boolean",
describe:
"If set, the command will fail if any migration fails and revert the migrations that were applied so far",
default: false,
})
},
handler: handlerP(
getCommandHandler("db/migrate", (args, cmd) => {
@@ -431,12 +437,14 @@ function buildLocalCommands(cli, isLocalProject) {
.option("workers", {
type: "string",
default: "0",
describe: "Number of worker processes in cluster mode or a percentage of cluster size (e.g., 25%).",
describe:
"Number of worker processes in cluster mode or a percentage of cluster size (e.g., 25%).",
})
.option("servers", {
type: "string",
default: "0",
describe: "Number of server processes in cluster mode or a percentage of cluster size (e.g., 25%).",
describe:
"Number of server processes in cluster mode or a percentage of cluster size (e.g., 25%).",
}),
handler: handlerP(
getCommandHandler(`start`, (args, cmd) => {