egg-sequelize cannot use config.test.js for migrations

Created on 11 May 2017  ·  2Comments  ·  Source: eggjs/egg

  • Node Version: 7.10.0
  • Egg Version: 1.2.1
  • Plugin Name: egg-sequelize
  • Plugin Version: 2.1.3
  • Platform: macOS, Linux
  • Mini Showcase Repository: None


I cannot configurate the environment variable to migrate using config.test.js.
I inspected in its source code around here.

module.exports = {
  development: Object.assign(defaultConfig, localConfig),
  test: Object.assign(defaultConfig, unittestConfig),
  production: Object.assign(defaultConfig, prodConfig),
};

It uses NODE_ENV=test for config.unittest.js.

I want the feature that we can use the value of EGG_SERVER_ENV to specify the migration environment.

I have not figure out how to add this feature, so I issue this for your help. Thanks.

egg-sequelize bug

Most helpful comment

2.1.4 is out

All 2 comments

这个代码本身就有 bug, 导出的三套环境的配置,其实都被最后一个环境覆盖了,所以加环境变量都是不生效的,我已经提了 PR https://github.com/eggjs/egg-sequelize/pull/14

2.1.4 is out

Was this page helpful?
0 / 5 - 0 ratings