fix(create-medusa-app): fix database name from input not used in setup (#11071)
This commit is contained in:
5
.changeset/light-fireants-attend.md
Normal file
5
.changeset/light-fireants-attend.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"create-medusa-app": patch
|
||||
---
|
||||
|
||||
fix(create-medusa-app): fix database name from input not used in setup
|
||||
@@ -224,6 +224,7 @@ export async function getDbClientAndCredentials({
|
||||
client: pg.Client
|
||||
dbConnectionString: string
|
||||
verbose?: boolean
|
||||
dbName?: string
|
||||
}> {
|
||||
if (dbName) {
|
||||
return await getForDbName({
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user