feat(create-medusa-app): prompt for database name with credentials (#8552)

* feat(create-medusa-app): prompt for database name with credentials

* refactor
This commit is contained in:
Shahed Nasser
2024-08-12 11:52:21 +03:00
committed by GitHub
parent 4eb2e8379f
commit f14f398685
2 changed files with 13 additions and 4 deletions

View File

@@ -105,10 +105,23 @@ async function getForDbName({
postgresUsername = answers.postgresUsername
postgresPassword = answers.postgresPassword
const { userDbName } = await inquirer.prompt([
{
type: "database",
name: "userDbName",
message: "Enter your Postgres user's database name",
default: answers.postgresUsername,
validate: (input) => {
return typeof input === "string" && input.length > 0
},
},
])
try {
client = await postgresClient({
user: postgresUsername,
password: postgresPassword,
database: userDbName,
...defaultConnectionOptions
})
} catch (e) {

View File

@@ -173,9 +173,7 @@ export default async ({
...factBoxOptions,
message: "Ran Migrations",
})
}
if (!skipDb && migrations) {
// create admin user
factBoxOptions.interval = displayFactBox({
...factBoxOptions,
@@ -204,9 +202,7 @@ export default async ({
...factBoxOptions,
message: "Created admin user",
})
}
if (!skipDb && migrations) {
// TODO for now we just seed the default data
// we should add onboarding seeding again if it makes
// since once we re-introduce the onboarding flow.