fix(create-medusa-app): fix database name from input not used in setup (#11071)

This commit is contained in:
Shahed Nasser
2025-01-21 12:35:46 +02:00
committed by GitHub
parent 13fe2f6776
commit cd758067d4
3 changed files with 9 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
"create-medusa-app": patch
---
fix(create-medusa-app): fix database name from input not used in setup

View File

@@ -224,6 +224,7 @@ export async function getDbClientAndCredentials({
client: pg.Client
dbConnectionString: string
verbose?: boolean
dbName?: string
}> {
if (dbName) {
return await getForDbName({

View File

@@ -104,7 +104,7 @@ export class MedusaProjectCreator
}
private async setupDatabase(): Promise<void> {
const dbName = `medusa-${slugify(this.projectName)}`
let dbName = `medusa-${slugify(this.projectName)}`
const { client, dbConnectionString, ...rest } =
await getDbClientAndCredentials({
dbName,
@@ -115,11 +115,12 @@ export class MedusaProjectCreator
this.client = client
this.dbConnectionString = dbConnectionString
this.isDbInitialized = true
dbName = rest.dbName || dbName
if (!this.options.dbUrl) {
this.factBoxOptions.interval = displayFactBox({
...this.factBoxOptions,
title: "Creating database...",
message: "Creating database...",
})
this.client = await runCreateDb({