eggjs / eggjs/egg

sequelize only migrate the first part of the configuration.

Open
#4,850 0 comments 0 reactions 0 assignees View on GitHub
Inactive
Dominant language
TypeScript
Stars
19k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

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

```base
{
"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](https://user-images.githubusercontent.com/93444868/147891279-1482a049-b792-4b89-bec4-ce9461285e53.png)
![image](https://user-images.githubusercontent.com/93444868/147891285-64699cc4-5a45-4f4b-b8e6-2c549df959b5.png)
![image](https://user-images.githubusercontent.com/93444868/147891293-2a8f6e7a-7ff3-4342-a43c-3284787d0cab.png)

## 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.