Skip to content

Need to support migrations executed on behalf of a user with readWrite privilege #5

@jchu59

Description

@jchu59
What version of Flyway are you using?

release-4.0.3-mongodb

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)

Java API

What database are you using (type & version)?

MongoDB 3.3

What operating system are you using?

OSX El Capitan

What did you do?

(Please include the content causing the issue, any relevant configuration settings, and the command you ran)
execute mongoFlyway.migrate on server where db is not yet created

What did you expect to see?

migration work

What did you see instead?

We have a microservice architecture in which each microservice uses a mongo client on behalf of a user with only readWrite privileges. When a db is not yet created, or also in the case where it is created but the schema_version collection is not yet created, a listDatabases method is called which is not available for a regular user. This throws a FlywayException and migration dies. Our workaround is to catch the exception on listDatabases and then make a call to find the schema_version collection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions