diff --git a/.changeset/light-fireants-attend.md b/.changeset/light-fireants-attend.md new file mode 100644 index 0000000000000..e3d78872403ca --- /dev/null +++ b/.changeset/light-fireants-attend.md @@ -0,0 +1,5 @@ +--- +"create-medusa-app": patch +--- + +fix(create-medusa-app): fix database name from input not used in setup diff --git a/packages/cli/create-medusa-app/src/utils/create-db.ts b/packages/cli/create-medusa-app/src/utils/create-db.ts index 26fd268ec19d3..097d9521f17c0 100644 --- a/packages/cli/create-medusa-app/src/utils/create-db.ts +++ b/packages/cli/create-medusa-app/src/utils/create-db.ts @@ -224,6 +224,7 @@ export async function getDbClientAndCredentials({ client: pg.Client dbConnectionString: string verbose?: boolean + dbName?: string }> { if (dbName) { return await getForDbName({ diff --git a/packages/cli/create-medusa-app/src/utils/project-creator/medusa-project-creator.ts b/packages/cli/create-medusa-app/src/utils/project-creator/medusa-project-creator.ts index 3ab3a21f0a905..cbb16ab3cfa4a 100644 --- a/packages/cli/create-medusa-app/src/utils/project-creator/medusa-project-creator.ts +++ b/packages/cli/create-medusa-app/src/utils/project-creator/medusa-project-creator.ts @@ -104,7 +104,7 @@ export class MedusaProjectCreator } private async setupDatabase(): Promise { - 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({