Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Multiple databases create cli #1239

Open
Melona-BS opened this issue Jan 18, 2023 · 1 comment
Open

Support Multiple databases create cli #1239

Melona-BS opened this issue Jan 18, 2023 · 1 comment

Comments

@Melona-BS
Copy link

What you are doing?

<config.js>

module.exports = {
  "development": {
    "databases": {
      "database1": {
        ...
        "dialect": "mysql"
      },
      "database2": {
        ...
        "dialect": "mysql"
      }
    }
  }
}

What do you expect to happen?

I want to input "sequelize db:create" in terminal

Loaded configuration file "config\config.js".
Using environment "development".
Database **database1, database2** created.

What is actually happening?

Just print Error message!!!
example...

ERROR: Dialect undefined does not support db:create / db:drop commands

I want "databases" set in config.js to be applied to create.

I know that read databases based on config.js and setting models in sequelize.
But cli doesn't work to create "databases" that setted within config.js.
Is there any way to do this(Create "databases" using cli or any other way)?

Dialect: mysql
Database version: Ver 8.0.28 for Win64 on x86_64
Sequelize CLI version: ^6.4.1
Sequelize version: ^6.19.0

@WikiRik
Copy link
Member

WikiRik commented Jan 18, 2023

As far as I know the CLI does not support multiple databases. PRs from the community slowly adding support for multiple databases is welcome.

For now something you can do is just set up the first database, update the config to the second database and run the same commands on the second database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants