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:
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user