diff --git a/lib/index.js b/lib/index.js index 32782c8..331592c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -199,10 +199,14 @@ internals.initialize = (server, next) => { if (err) { console.error(err); - process.exit(1); + server.root.stop(() => { + process.exit(1); + }); } - process.exit(0); + server.root.stop(() => { + process.exit(0); + }); }); } diff --git a/lib/schema.js b/lib/schema.js index edbfc71..92151cd 100644 --- a/lib/schema.js +++ b/lib/schema.js @@ -9,7 +9,7 @@ internals.model = Joi.func(); // Really, a class internals.configBase = Joi.object({ knex: [Joi.object(), Joi.func()], // Either a knex config (object) or a knex instance (func) migrationsDir: Joi.string(), - makeMigrationMode: Joi.boolean() + makeMigrationMode: Joi.string().allow('create', 'alter', 'test').optional() }); exports.plugin = internals.configBase.keys({