Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't migrate as long as there are compile errors #979

Closed
axaluss opened this issue Mar 29, 2015 · 10 comments
Closed

can't migrate as long as there are compile errors #979

axaluss opened this issue Mar 29, 2015 · 10 comments

Comments

@axaluss
Copy link

@axaluss axaluss commented Mar 29, 2015

I try to flywayMigrate but there are compile errors.
So the migrate task is never executed.

The funny thing is, that i can only generate the proper code with jooq after i migrated the database.

Is there a way get around the compile dependency?

@axaluss
Copy link
Author

@axaluss axaluss commented Mar 30, 2015

have a look at this fix: https://github.com/axaluss/FlywaySbt

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Mar 31, 2015

Thanks for the report. This is something I plan to change for all build tool clients (ant, maven, gradle, sbt) in time for 4.0

@nkgm
Copy link

@nkgm nkgm commented Apr 7, 2015

+1
On maven a workaround is possible. SBT however requires more manual labor.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Dec 30, 2015

The default location for Maven, Gradle and SBT has been change to filesystem:src/main/resources/db/migration which should improve integration with jOOQ and remove the need for compilation when only using SQL files

@nafg
Copy link

@nafg nafg commented May 31, 2016

The fix breaks sbt subprojects (I had to add flywayLocations := Seq("db/migration")) since they are in a different subdirectory. I guess it would also not work with Play's directory layout or any other customization.

@mikebridge
Copy link

@mikebridge mikebridge commented Sep 7, 2016

Is there an example of how to set this up in sbt? I still have a dependency on compilation in a subproject with 4.0.3:

lazy val `my-subproject` = (project in file("my-subproject"))
 .settings(
    flywayUrl := "jdbc:postgresql://localhost:5432/mydb",
    flywayLocations := Seq("db/migration"),
    flywayUser := "myuser")

@nafg
Copy link

@nafg nafg commented Sep 8, 2016

@mikebridge what does inspect tree flywayMigrate say the dependency is?

Also why do you need to override flywayLocations?

@mikebridge
Copy link

@mikebridge mikebridge commented Sep 9, 2016

@nafg It looks like flywayMigrate depends on fullClasspath.

As for flywayLocations, I believe I applied your May 30 workaround for subprojects

> inspect tree identity-manager/flywayMigrate
[info] identity-manager/*:flywayMigrate = Task[Unit]
[info]   +-identity-manager/*:flywayConfig = Task[org.flywaydb.sbt.FlywayPlugin$Config]
[info]   +-identity-manager/runtime:fullClasspath = Task[scala.collection.Seq[sbt.Attributed[java.io.File]]]
[info]     +-identity-manager/runtime:exportedProducts = Task[scala.collection.Seq[sbt.Attributed[java.io.Fil..
[info]     | +-identity-manager/compile:packageBin::artifact = Artifact(identity-manager,jar,jar,None,List(co..
[info]     | +-identity-manager/compile:packageBin::artifactPath = identity-manager/target/scala-2.11/identit..
[info]     | +-identity-manager/runtime:productDirectories = Task[scala.collection.Seq[java.io.File]]
[info]     | | +-identity-manager/compile:classDirectory = identity-manager/target/scala-2.11/classes

@nafg
Copy link

@nafg nafg commented Sep 9, 2016

Hmm, I suspect it might not be necessary on the latest version but I'm not sure

@warpian
Copy link

@warpian warpian commented Sep 8, 2017

the fix for sbt in flyway-sbt 4.2.0 is not working in my project. the cyclic dep is still there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants