Evolution Script is not applied

76 views
Skip to first unread message

Tobias Heer

unread,
May 4, 2017, 4:12:29 AM5/4/17
to Play Framework

Hello, 
I worked trough the Tutorials. PlaySlick Evolutions Developing-with-the-H2-Database

I configured application.conf
slick.dbs.default.profile="slick.jdbc.H2Profile$"
slick.dbs.default.db.driver="org.h2.Driver"
slick.dbs.default.db.url="jdbc:h2:mem:playSlick;DB_CLOSE_DELAY=-1"
slick.dbs.default.db.user=sa
slick.dbs.default.db.password=""

evolutionplugin=enable

Added the dependencies build.sbt
libraryDependencies ++= Seq(
  "com.typesafe.slick" %% "slick" % "3.2.0",
  "com.typesafe.play" %% "play-slick" % "2.1.0",
  "com.typesafe.play" %% "play-slick-evolutions" % "2.1.0",
  "com.h2database" % "h2" % "1.4.195"
)

And added an 1.sql script into conf/evolutions/default
It is to long to post Into the Mail. When I run it with an SQL Console it works. 

After starting the Application i get the DB 'default' need evolution screen. 
When i click the Button the Application works as normal.

When i Try to look for the tables they are not in the DB. 
 URL: jdbc:h2:mem:default
 URL: jdbc:h2:mem:playSlick

Picute from Intellj integrated Database manager. I also looked at the webDB manager also no tables there. 



I tryed to get more log output by adding a logback.xml with 
<logger name="play.api.db.slick" level="FATAL" />

Now i got some debug outputs but nothing that really helps. 

Do i miss some configurations? Am I looking into the wrong DB?

Best regards from Germany 

Tobias Heer

Rafael Trindade Chiappetta

unread,
May 4, 2017, 6:59:27 AM5/4/17
to play-fr...@googlegroups.com
Check if the user has permission to create tables.

=====
Rafael Trindade Chiappetta


--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/1ed907f2-0d0c-45fb-9029-5f76efdd14f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tobias Heer

unread,
May 4, 2017, 7:58:22 AM5/4/17
to Play Framework
There is only one User and "SA" has Admin rights.
I'm using what Play! provided. Except creating tables by hand, I haven't toughed the DB. 






Do I have to specific tell the evolution script a user? 
Can't find any documentation about a User needed for evolution. 

- Tobias Heer

PS: The project is on GitHub


=====
Rafael Trindade Chiappetta


To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

Mariot Chauvin

unread,
May 4, 2017, 8:40:47 AM5/4/17
to play-fr...@googlegroups.com
Hi, 

 Except creating tables by hand

It may be outdated, but I think evolution does not expect you to do this.  Evolution stores in a specific table play_evolutions, the current state of the created tables, so if you created by hand your tables it may not know what is the current state and not apply your evolutions as expected

Not sure this is the cause of your problem.




To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/0b0387a0-b135-4d9f-a2e8-fc684f318c24%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



This e-mail and all attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender and delete the e-mail and all attachments immediately. Do not disclose the contents to another person. You may not use the information for any purpose, or store, or copy, it in any way.  Guardian News & Media Limited is not liable for any computer viruses or other material transmitted with or as part of this e-mail. You should employ virus checking software.
 
Guardian News & Media Limited is a member of Guardian Media Group plc. Registered Office: PO Box 68164, Kings Place, 90 York Way, London, N1P 2AP.  Registered in England Number 908396


Tobias Heer

unread,
May 4, 2017, 9:03:53 AM5/4/17
to Play Framework
Hello Mariot,
that shouldn't be the problem. I removed all of the tables after testing and changed the DB URL.
Also I don't have the play_evolutions table. 

If Play! would think that the tables are already there then the DB needs Evolutionscreen wouldn't show up i think. 

- Tobias Heer 

Rafael Trindade Chiappetta

unread,
May 4, 2017, 9:25:41 AM5/4/17
to play-fr...@googlegroups.com
I this answer will fix your problem: http://stackoverflow.com/a/28950817/2195551

H2 databases are in memory, and when you try to access it from intelliJ, the IDE will try to access another instance of the in memory database. That's why your app works, but you can't see the tables from IntelliJ.



=====
Rafael Trindade Chiappetta


To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/4abb703f-475e-418c-865b-e7baaab492c0%40googlegroups.com.

Tobias Heer

unread,
May 4, 2017, 10:30:30 AM5/4/17
to Play Framework
Rafael thank you very very much. 

I was on this Stackoverflow question .....

It's working now. Tables are created and i can see them. 

And again thank you very much. 

- Tobias Heer

=====
Rafael Trindade Chiappetta


Rafael Trindade Chiappetta

unread,
May 4, 2017, 10:57:33 AM5/4/17
to play-fr...@googlegroups.com
no problem, man!

=====
Rafael Trindade Chiappetta


To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/0b49536e-3f85-4c87-90a6-a95250764b1f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages