1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: Database migrator does use the databaseSchema option

closes #387
This commit is contained in:
ivaosthu 2019-02-01 08:06:02 +01:00 committed by Ivar Conradi Østhus
parent a9ce0767d2
commit 8b9f9dbd2c
5 changed files with 14 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 3.1.6
- fix: Database migrator does use the databaseSchema option.
## 3.1.5
- feat(permission): Implement beta support for permissions.

View File

@ -27,6 +27,13 @@ const argv = require('yargs')
'The full databaseUrl to connect to, including username and password',
demand: true,
type: 'string',
})
.option('databaseSchema', {
alias: 's',
describe: 'The database schema to use',
default: 'public',
demand: false,
type: 'string',
}).argv;
serverImpl

View File

@ -44,6 +44,7 @@ unleash
Available unleash options includes:
- **databaseUrl** - the postgress database url to connect to. Should include username/password.
- **databaseSchema** - the postgress database schema to use. Defaults to 'public'
- **port** - Which port should the unleash-server bind to?
- **enableLegacyRoutes** (boolean) - allows you to turn on/off support for legacy routes to support older clients. Enabled by default.
- **serverMetrics** (boolean) - Use this option to turn off prometheus metrics.

View File

@ -7,6 +7,7 @@ const THIRTY_DAYS = 30 * 24 * 60 * 60 * 1000;
const DEFAULT_OPTIONS = {
databaseUrl: process.env.DATABASE_URL,
databaseSchema: 'another',
port: process.env.HTTP_PORT || process.env.PORT || 4242,
host: process.env.HTTP_HOST,
baseUriPath: process.env.BASE_URI_PATH || '',

View File

@ -49,7 +49,7 @@ async function start(opts) {
const options = createOptions(opts);
try {
await migrator({ databaseUrl: options.databaseUrl });
await migrator(options);
} catch (err) {
logger.error('Failed to migrate db', err);
throw err;