1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: Add option to disable database migrations #526 (#527)

Closes #526
This commit is contained in:
Shobhit Khandelwal 2019-11-18 12:40:58 +05:30 committed by Ivar Conradi Østhus
parent 092e571dc7
commit 80a4d41f0f
2 changed files with 6 additions and 1 deletions

View File

@ -28,6 +28,7 @@ function defaultOptions() {
dropBeforeImport: false,
getLogger: defaultLogProvider,
customContextFields: [],
disableDBMigration: false,
};
}

View File

@ -72,7 +72,11 @@ async function start(opts) {
const logger = options.getLogger('server-impl.js');
try {
await migrator(options);
if (options.disableDBMigration) {
logger.info('DB migrations disabled');
} else {
await migrator(options);
}
} catch (err) {
logger.error('Failed to migrate db', err);
throw err;