Problem with Flyway with Username and Password

See original GitHub issue

I’m trying to get the library working with Spring Boot + Postgres + Flyway. Everything works like a charm. But when I add a dedicated username/password for Flyway tests fail.
I had a quick look at the code and saw that Flyway Boot AutoConfiguration internally creates a data source if either url or user is not null. It seems this data source is not overridden to point to the embedded database. Am I missing something?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
tomix26commented, Jul 12, 2019

Nice solution. Maybe I could implement it directly into the library. I’ll think about it.

0reactions
akefiradcommented, Jul 12, 2019

Yeah, but we don’t have profiles in production, not working for us 😞 What I did though is to add an application initializer. I posted the code here for future reference. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authentication - Flyway by Redgate • Database Migrations ...
In order to log in to your database, the typical approach is to set your username and password in the Flyway configuration file....
Read more >
java - Spring Boot FlywayException: Unable to connect to the ...
FlywayException: Unable to connect to the database. Configure the url, user and password! I have my Spring Boot settings in my application.yml ...
Read more >
Database Migrations with Flyway - Baeldung
In this tutorial, we'll explore key concepts of Flyway and how we can use this framework to continuously remodel our application's database ...
Read more >
Testing a Flyway Database Migration - Redgate Software
No passwords are saved in these files, just usernames. ... Here is a typical error from a run, where Flyway could not run...
Read more >
Getting Started with Flyway and Version-Based Database ...
We already solved these problems for our Java code. There are several tools, like git, ... The parameters flyway.user and flyway.password are optional....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found