I am using play 2.2 with Ebean ORM deployed to Heroku. New to Ebean and I am having trouble. I need to store an image file and am having compatibility issues. Ebean will allow the use of @Lob to create a Blob, or without the tag a longvarbinary. I need a bytea for Postgres. Is it possible to do this? If not, is there any other way of storing an image file?
Edit:
This is the error message I get when attempting to push the local repo, which works fine, to Heroku.
2015-04-30T15:43:02.546699+00:00 app[web.1]: Play server process ID is 3
2015-04-30T15:43:04.524027+00:00 app[web.1]: [info] play - database [default] connected at jdbc:postgresql://ec2-184-73-221-47.compute- 1.amazonaws.com:5432/dcn8fp0jefq7ef
2015-04-30T15:43:05.490712+00:00 app[web.1]: [error] play - ERROR: type "blob" does not exist
2015-04-30T15:43:05.490720+00:00 app[web.1]: Position: 376 [ERROR:0, SQLSTATE:42704]
2015-04-30T15:43:05.531616+00:00 app[web.1]: Oops, cannot start the server.
2015-04-30T15:43:05.532587+00:00 app[web.1]: at play.api.db.evolutions.Evolutions$.checkEvolutionsState(Evolutions.scala:193)
2015-04-30T15:43:05.543409+00:00 app[web.1]: at play.api.db.evolutions.EvolutionsPlugin.onStart(Evolutions.scala:459)
2015-04-30T15:43:05.543526+00:00 app[web.1]: at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
2015-04-30T15:43:05.543570+00:00 app[web.1]: at scala.collection.immutable.List.foreach(List.scala:318)
2015-04-30T15:43:05.543479+00:00 app[web.1]: at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
2015-04-30T15:43:05.543095+00:00 app[web.1]: at play.api.db.evolutions.Evolutions$.applyScript(Evolutions.scala:277)
2015-04-30T15:43:05.5
This is how it is defined in my model:
@Lob
public byte[] profilePicture;
This is my application.conf settings:
# Database configuration
# ~~~~~
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
#
db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:mem:play;MODE=PostgreSQL"
#
# You can expose this datasource via JNDI if needed (Useful for JPA)
# db.default.jndiName=DefaultDS
# Evolutions
# ~~~~~
# You can disable evolutions if needed
# evolutionplugin=disabled
# Ebean configuration
# ~~~~~
# You can declare as many Ebean servers as you want.
# By convention, the default server is named `default`
#
ebean.default="models.*"
I also have a Procfile that looks like this.
web: target/universal/stage/bin/hello-play-backbone -Dhttp.port=${PORT} $PLAY_OPTS
-DapplyEvolutions.default=true -Ddb.default.url=${DATABASE_URL} -Ddb.default.driver=org.postgresql.Driver