Skip to content

Unable to run migrations with several db connections config #1333

@jsmonkey

Description

@jsmonkey

Hi,

I'm using ormconfig.json with multiple connections config:

[{
    "name": "db1",
    "type": "mysql",
    "host": "localhost",
    "port": 3306,
    "username": "root",
    "password": "root",
    "database": "db1",
    "migrations": ["/migrations/*.js"],
    "entities": ["/entities/*.js"]
}, {
    "name": "db2",
    "type": "mysql",
    "host": "localhost",
    "port": 3307,
    "username": "root",
    "password": "root",
    "database": "db2",
    "entities": ["/entities/*.js"]
}]

After typeorm migrations:run I got Cannot find connection default because its not defined in any orm configuration files..
So need somehow provide the first connection config for migrations running.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions