Questions tagged [playframework-evolutions]

A tool to track and organize database schema evolutions

Play Evolutions is used to manage database evolutions - it tracks and organizes your database schema evolutions.

96 questions
24
votes
2 answers

Rolling an evolution back

This question might seem stupid, but I cannot find any instruction on how to roll back an evolution in Play 2.0. Google only finds pages which say that the "Downs" section of an evolution file is used for that and that's all. Any pointers or…
noncom
  • 4,962
  • 3
  • 42
  • 70
16
votes
2 answers

How to handle Play Framework 2 database evolutions in production

It seems that whenever I change my models, Play Framework asks me to run a script that deletes my entire schema and recreates it. Obviously this won't work for production, so what is the proper way to handle this in production? Note, I'm using…
12
votes
5 answers

How to apply manually evolutions in tests with Slick and Play! 2.4

I would like to manually run my evolution script at the beginning of each test file. I'm working with Play! 2.4 and Slick 3. According to the documentation, the way to go seems to be: Evolutions.applyEvolutions(database) but I don't manage to get…
Simon
  • 6,025
  • 7
  • 46
  • 98
11
votes
2 answers

How to apply play-evolutions when running tests in play-framework?

I have problems with evolutions when running tests in play framework using playframework v2.6.6 for scala play-slick v3.0.2 play-slick-evolutions v3.0.2 The test looks like this: class TestFooController extends PlaySpec with GuiceOneServerPerSuite…
11
votes
1 answer

How do I create a function in PostgreSQL using evolutions in the Play framework?

With the Play Framework 2.1 I have the following SQL defined in my evolution: CREATE OR REPLACE FUNCTION idx(myArray anyarray, myElement anyelement) RETURNS int AS $$ SELECT i FROM ( SELECT…
9
votes
1 answer

Ordering Play Evolutions on Multiple Databases

I've got an environment where I'm using multiple databases (A and B) with different sets of evolutions for each, thusfar completely successfully. However, one set of database evolutions always gets applied first, all the evolutions for B database…
7
votes
0 answers

How to load Evolutions script (database migration scripts) from external folder or external jar?

We are using Play 2.7 (Java) in production. We have a set of common Ebean models (as an external library/jar) that are shared between different Play projects but we are stuck because of Play Evolutions scripts. Is there any way using which these…
7
votes
2 answers

Play Evolutions and JPA in Play Framework 2.4

I migrated a Play project from Version 2.3.4 to 2.4.2. The projects uses JPA (Hibernate) and Evolutions. I have an initial Evolutions SQL script, which fills the database with some sample data. This script is now not working anymore, because the…
7
votes
2 answers

Play Framework 2 Ebean specify default value for field

I have a simple model in Play Framework 2, and I would like to specify a default value to be inserted on a specify INT column if none is provided when the INSERT is performed. Model: @Entity @Table(name = "DashboardOptions", schema = "dbo") public…
sean.boyer
  • 1,187
  • 16
  • 24
6
votes
1 answer

"Database 'default' is in inconsistent state!" comes and goes

I have the problem that the play database evolution on the deployed server is in inconsistent state again and again. I don't understand what's the problem. All the tests work fine (in memory) I can start the application with run (in memory) I…
myborobudur
  • 4,385
  • 8
  • 40
  • 61
6
votes
2 answers

Play Framework 2.1.1 Deployment Issues

So, I'm trying to deploy my very simple Play Framework 2.1.1 app but whenever I pass flags through the command line for port and to apply database evolutions, they are ignored. For example: sudo play start -Dhttp.port=80…
6
votes
1 answer

How to apply evolutions manually and mark as resolved on play framework 2

Is it to possible mark evolutions as applied in playframework 2? Scenario: I had to change an already applied evolution file because it was incompatible with H2 causing the remaining evolutions not to be applied during tests. So, I fixed it. Now the…
Johnny Everson
  • 8,343
  • 7
  • 39
  • 75
6
votes
2 answers

Regenerate evolution scripts in play 2

I am still developing first version of my application on play 2. How could I regenerate evolution scripts?
angelokh
  • 9,426
  • 9
  • 69
  • 139
5
votes
2 answers

Play Framework 2.3 how to reset database?

In the Play 2.3.x documentation on Evolutions it says In development mode however it is often simpler to simply trash your development database and reapply all evolutions from the beginning. However it doesn't give instructions on how to do this.…
KJ50
  • 765
  • 1
  • 10
  • 27
4
votes
0 answers

Play + Slick + Evolutions Testing Advice

I've never been 100% happy with the way I test Play applications. I've settled on an approach that I've been using for a while but it feels a bit hacky and that I'm missing something simple. I use SQLite and have a single database configuration…
Oli
  • 1,112
  • 1
  • 10
  • 25
1
2 3 4 5 6 7