GithubHelp home page GithubHelp logo

Comments (6)

wilkinsona avatar wilkinsona commented on September 27, 2024 2

That sounds reasonable to me. On the Boot side, perhaps we should consider some failure analysis for the exception that Flyway throws as well?

from start.spring.io.

snicoll avatar snicoll commented on September 27, 2024

The test and the app fails and this is not the only case where this happens.

We are usually trying to avoid any kind of scaffolding here and we generally favor clear exceptions (you have to do something) vs generating code to make things work and "hide" important information from you. We also absolutely don't want to be in a situation where we generate too much stuff and users have to manually remove what we've generated as we thought would be a convenience to them.

I am torn on this particular use case though, flagging for team attention.

from start.spring.io.

wilkinsona avatar wilkinsona commented on September 27, 2024

I think it's worth noting that, IIRC, this is only the case in recent versions of Flyway. Previously, it would silently do nothing if it didn't find any migrations to run. That leads me to believe that the Flyway team now think it's better to fail and guide the user towards creating a migration than to silently do nothing. I'm inclined to agree with them.

from start.spring.io.

snicoll avatar snicoll commented on September 27, 2024

Perhaps we could generate the src/main/resources/db/migration folder though?

from start.spring.io.

tedyoung avatar tedyoung commented on September 27, 2024

I think that's a good way to go. I always have my training students run the contextLoads test after generation to make sure everything was imported, etc., correctly. When it failed, it wasn't immediately clear how to fix it as Flyway's docs don't mention an empty project -- but that's something they need to do if they're going to throw an exception.

from start.spring.io.

tedyoung avatar tedyoung commented on September 27, 2024

So it looks like Boot is the one complaining as part of autoconfigure (see https://github.com/spring-projects/spring-boot/blob/2.1.x/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java#L191)

For adding Flyway to an existing Boot project that already has database schemas, etc., that check makes sense, but for a newly generated project, it's confusing ("how can I write a migration when I don't have any code yet?"). I feel like there needs to be better guidance, though I agree that generating an empty migration, which then has to be modified or thrown away, might not be best.

from start.spring.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.