0

I'm using Play 1.2.4 on Heroku and I just reset my database so that I can switch from dev-mode/JPA to using prod-mode/evolutions.

However, I can not get the script to run.

I created my 1.sql file and put it in /db/evolutions. I set jpa.ddl to create so that it will initially create the tables and I checked to make sure it did that. When I run play evolutions from the CLI, I get the following:

Cannot connected to the database : FATAL: no pg_hba.conf entry for host "my_host", user "my_username", database "my_db", SSL off

When I try to do heroku run "play evolutions:apply --%prod" I get:

Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true -Djava.rmi.server.useCodebaseOnly=true
~ Evolutions are not enabled. Create a db/evolutions directory to create your first 1.sql evolution script.

Do I need a pg_hba.conf file? In my application.conf I have:

db=${DATABASE_URL}

which is a heroku environment variable. I know that I don't have access to those locally so I tried copying the contents of the heroku variable to my local evironment variable $DATABASE_URL which I believe is what is being pulled from when I run play evolutions.

eliot
  • 1,319
  • 1
  • 14
  • 33

2 Answers2

0

As advised by Heroku, I added the db folder to my .gitignore file when I first created this project.

Removing it from there and recommitting to Heroku was what I had to do to fix it.

eliot
  • 1,319
  • 1
  • 14
  • 33
0

I have no problem with git adding files, I think you have some problem with the database name definition. I posted my working evolutions config setup for play 2.4, Slick 3.0.3 & postgres. I got automatically generated the *.sql files placed in the evolution folder.

Regenerate evolution scripts in play 2

Cheers

Community
  • 1
  • 1