Play database migration not working when upgrading from 2.3 to 2.7

14 visualizzazioni
Passa al primo messaggio da leggere

Olivier Poppon

da leggere,
15 mag 2019, 03:43:2515/05/19
a ScalikeJDBC Users Group
Hello,

(Note : My error is similar to one posted by Toby Hobson in 2016, but it was for Play 2.5 it was not mentionning database migration)

I have migrated a Play 2.3 application to 2.7.
In the process, Play lost the ability to perform database migrations (using the built-in evolution functionnality, not flyway)

To do so, in build.sbt, I added the evolutions dependency, but now I have a No implementation for play.api.db.DBApi was bound error.

Can you see if I am missing something ?

Thanks a lot !

build.sbt -2.3
libraryDependencies ++= Seq(
"org.scalikejdbc"    %% "scalikejdbc"                % "2.4.+",
  "org.scalikejdbc"    %% "scalikejdbc-config"         % "2.4.+",
"org.scalikejdbc"    %% "scalikejdbc-play-plugin"    % "2.3.+"
)

build.sbt - 2.7
libraryDependencies ++= Seq(
guice,
evolutions,
"org.scalikejdbc"    %% "scalikejdbc"                    % "3.3.2",
"org.scalikejdbc"    %% "scalikejdbc-config"            % "3.3.2",
"org.scalikejdbc"    %% "scalikejdbc-play-initializer"         % "2.7.0-scalikejdbc-3.3"
)

application.conf - 2.7
play.modules {
enabled += "scalikejdbc.PlayModule"
disabled += "play.api.db.DBModule"  
}

play.evolutions.db.enabled=true
play.evolutions.db.autoApply=true



Olivier Poppon

da leggere,
20 mag 2019, 08:30:0820/05/19
a ScalikeJDBC Users Group
Never mind.

It was getting too complicated. I switch to flyway...
Rispondi a tutti
Rispondi all'autore
Inoltra
0 nuovi messaggi