Skip to content

switchDatabase errors are ignored which can lead to unexpected behaviour #470

Closed
@yonjah

Description

@yonjah

connect.js doesn't check if switchDatabase actually returns an error
https://github.com/db-migrate/node-db-migrate/blob/master/connect.js#L39
You can test this by setting a scope with a db that the user does not have access to

This can cause unexpected database corruptions since the migrations will keep running
on the main database.
If the migration statements fail to run the error will be misleading since it will point to the migration statement causing the error where the actual issue is the failing to change to the required database


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

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