egg icon indicating copy to clipboard operation
egg copied to clipboard

sequelize only migrate the first part of the configuration.

Open DanaCoding opened this issue 4 years ago • 0 comments

What happens?

执行npx sequelize db:migrate。但只在config的第一个database_development中生成了users表,其他两个数据库没有成功生成users表。

{
  "development": {
    "username": "root",
    "password": null,
    "database": "database_development",
    "host": "127.0.0.1",
    "dialect": "mysql"
  },
  "test": {
    "username": "root",
    "password": null,
    "database": "database_test",
    "host": "127.0.0.1",
    "dialect": "mysql"
  },
  "production": {
    "username": "root",
    "password": null,
    "database": "database_production",
    "host": "127.0.0.1",
    "dialect": "mysql"
  }
}

image image image

Mini Showcase Repository(REQUIRED)

Provide a mini GitHub repository which can reproduce the issue. Use npm init egg --type=simple bug then upload to your GitHub

How To Reproduce

Steps to reproduce the behavior:

  1. database/config.json中自动生成的配置,
  2. 在MySQL中分别创建了这3个数据库database_development database_test database_production
  3. 且在database/migrations中自动生成了一个关于users的文件,配置后。
  4. 执行npx sequelize db:migrate。但只在配置的第一个database_development中生成了users表,配置中的其他两个数据库没有成功生成users表

Expected behavior

当然是期望3个数据库都成功生成users表。

Context

  • Node Version: 16.13.1
  • Egg Version: 2.15.1
  • Plugin Name: egg-sequelize
  • Plugin Version: 6.0.0
  • Platform: win10 pro

DanaCoding avatar Jan 02 '22 22:01 DanaCoding