I developed the first web application using local PostgreSQL 9.1 on OSX (Lion 10.7.4) using Play! Box 2.0.3. I started by connecting to the database defined in conf / application.conf (relative to the application directory) with
db.default.driver=org.postgresql.Driver db.default.url="jdbc:postgresql://localhost/fotoplay" db.default.user=foo db.default.password=bar
(username and password were changed before publication). This works for writing and testing. Now I want to deploy to Heroka. I installed Procfile (in the application directory) with a single line:
web: target/start -Dhttp.port=${PORT} ${JAVA_OPTS} -DapplyEvolutions.default=false -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=$DATABASE_URL
I exported DATABASE_URL to .bash_profile so that I can send $ DATABASE_URL to the system command line and receive
postgres://foo: bar@localhost /photoplay
In Heroku, I created an instance of postgresql. I'm not sure how to write a database evolution to populate a hero, so I turned off this evolution and manually populated my database. My current evolutions create tables and populate them with some source data from some csv files, so I will need to put the csv files somewhere accessible to the hero. At least for the first pass, I donβt want to deal with this problem yet. But as a result of the manual steps, I have a populated database on Heroku.
In this configuration, my application runs correctly locally. However, I am not using DATABASE_URL, which seems to be wrong. I clicked on HEROKU and was unable to connect to the database. Error:
Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "foo"
If I remove the username and password, I will break the local configuration. I should use DATABASE_URL instead of the old syntax, but I don't know how to do it. I donβt think I can understand this experimentally (wandering arrogant spaces are hopeless, and there are several possible configuration settings that may be involved and subject to typos). Any directions as to how I should configure application.conf would be appreciated.