feature: add db:create command (#8760)

This commit is contained in:
Harminder Virk
2024-08-26 15:04:52 +05:30
committed by GitHub
parent cd4063de74
commit 7c2cfc132a
9 changed files with 396 additions and 1 deletions

View File

@@ -125,6 +125,28 @@ function buildLocalCommands(cli, isLocalProject) {
desc: `Create a new Medusa project.`,
handler: handlerP(newStarter),
})
.command({
command: "db:create",
desc: "Create the database used by your application",
builder: (builder) => {
builder.option("db", {
type: "string",
describe: "Specify the name of the database you want to create",
})
builder.option("interactive", {
type: "boolean",
default: true,
describe:
"Display prompts. Use --no-interactive flag to run the command without prompts",
})
},
handler: handlerP(
getCommandHandler("db/create", (args, cmd) => {
process.env.NODE_ENV = process.env.NODE_ENV || `development`
return cmd(args)
})
),
})
.command({
command: `telemetry`,
describe: `Enable or disable collection of anonymous usage data.`,