Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to regenerate SQL scripts by Play Slick Evolution

I am using Play 2.4.0 and Slick 3.1. I am trying to figure out how I can regenerate SQL by Slick evolution. I modified my classes in models.* but no sql scripts are regenerated. Please help.

Here is my configuration:

plugin.sbt

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.0")

build.sbt

libraryDependencies ++= Seq(
・・・
evolutions,
"com.typesafe.play" % "play-slick_2.11" % "1.1.1",
"com.typesafe.play" %% "play-slick-evolutions" % "1.1.1",
・・・ 
)

As mentioned in the official document https://www.playframework.com/documentation/2.4.x/Evolutions or the question " Regenerate evolution scripts in play 2 ", I am running my app like below.

  • I am running myapp in the dev mode
  • in application.conf I have this line not commented :
    • slick.default="models.*"
    • play.evolutions.enabled=true
  • there is only one file in your evolutions folder and it's 1.sql
  • it has this comment at the beginning:

    # To stop Slick DDL generation, remove this comment and start using Evolutions

like image 475
Yohei Onishi Avatar asked Nov 09 '22 21:11

Yohei Onishi


1 Answers

It's not possible since 2.4, I made some workaround:

https://stackoverflow.com/a/35383919/2235939

Hope it helps

like image 145
Michał Jurczuk Avatar answered Nov 24 '22 01:11

Michał Jurczuk