diff --git a/models/index.js b/models/index.js index ce20194..fd6cc00 100644 --- a/models/index.js +++ b/models/index.js @@ -3,22 +3,17 @@ const path = require("path"); const Sequelize = require("sequelize"); const basename = path.basename(__filename); -const env = process.env.NODE_ENV || "development"; +const env = process.env.NODE_ENV; // eslint-disable-next-line import/no-dynamic-require const config = require(`${__dirname}/../config/config.json`)[env]; const db = {}; -let sequelize; -if (config.use_env_variable) { - sequelize = new Sequelize(process.env[config.use_env_variable], config); -} else { - sequelize = new Sequelize( - config.database, - config.username, - config.password, - config - ); -} +const sequelize = new Sequelize( + config.database, + config.username, + config.password, + config +); fs.readdirSync(__dirname) .filter(file => {