Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
Support non-default schema in the lumber update command. Fix #175
Browse files Browse the repository at this point in the history
  • Loading branch information
SeyZ committed Nov 4, 2018
1 parent 95e5cad commit 7a1c617
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions services/prompter.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ async function Prompter(program, requests) {
});
}

if (isRequested('dbSchema')) {
if (process.env.DATABASE_SCHEMA) {
envConfig.dbSchema = process.env.DATABASE_SCHEMA;
} else {
prompts.push({
type: 'input',
name: 'dbSchema',
message: 'What\'s the database schema? [optional]',
description: 'Leave blank by default',
when: answers => answers.dbDialect !== 'sqlite',
default: (args) => {
if (args.dbDialect === 'postgres') { return 'public'; }
return '';
},
});
}
}
} else {
if (isRequested('dbDialect')) {
Expand Down

0 comments on commit 7a1c617

Please sign in to comment.