From 80a4d41f0f43402577d02d643c4288fda329c1f0 Mon Sep 17 00:00:00 2001 From: Shobhit Khandelwal Date: Mon, 18 Nov 2019 12:40:58 +0530 Subject: [PATCH] fix: Add option to disable database migrations #526 (#527) Closes #526 --- lib/options.js | 1 + lib/server-impl.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/options.js b/lib/options.js index 6b5e5ccb58..e1178ecca9 100644 --- a/lib/options.js +++ b/lib/options.js @@ -28,6 +28,7 @@ function defaultOptions() { dropBeforeImport: false, getLogger: defaultLogProvider, customContextFields: [], + disableDBMigration: false, }; } diff --git a/lib/server-impl.js b/lib/server-impl.js index 378ada13b1..cb257b4975 100644 --- a/lib/server-impl.js +++ b/lib/server-impl.js @@ -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;