From 461e0d06eac3520d782f10714ac738c6136a04a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8C=AF=E9=9C=87?= <865702942@qq.com> Date: Sat, 23 Apr 2016 14:27:47 +0800 Subject: [PATCH] config file changed --- src/config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/config.js b/src/config.js index 9ace750..d3b5663 100644 --- a/src/config.js +++ b/src/config.js @@ -77,5 +77,17 @@ export default function(param) { merge(_config, param); } + if (!_config.orm.dialectModulePath) { + let modulePath = join(process.cwd(), 'node_modules'); + let moduleName = ({ + sqlite: 'sqlite3', + mysql: 'mysql', + mariadb: 'mysql', + postgres: 'pg', + mssql: 'tedious' + })[_config.orm.dialect]; + + _config.orm.dialectModulePath = require.resolve(join(modulePath, moduleName)); + } return _config; }