I am using Intellij 15.0.2 (linux, 64 bit) and have noticed a strange problem with play 2.3.7 and 2.4.6 with respect to differences in database evolutions applied when running the app and when testing with JUnit. Specifically, things work fine while running (with a Play 2 App run configuration or from the activator console) with respect to my DB evolutions. However when I run a JUnit test from inside IntelliJ, it seems like a different evolution takes place.
In my situation, I have a evolution script (1.sql) that creates a table and alters it so that certain columns have default values. This works fine (on an H2 database running in server mode). However when I then run a JUnit script that hits this DB, some other SQL script is running that changes the order of the columns and does not run the ALTER statements. I do not know where this DDL is coming from. It almost seems like Intellij is dropping the table, and then using the Java object I am testing to recreate the specific table. Evidence of this behaviour comes from the order of the columns, which is similar to that of the object.
Things work fine if I remove the evolutions from the play project or if I skip Intellij and just run the JUnit test from the activator console. It would be nice to be able to run Junit tests in Intellij and have them work consistently with the rest fo the framework.
I am new to play (and Intellij 15) so maybe I have something configured wrong. Any insight appreciated.