implementé mi aplicación muy simple en heroku siguiendo los tutoriales
funciona bien en mi host local cuando lo ejecuto con sbt run pero falla en heroku.
aquí está mi 1.sql:
# --- !Ups create table contact ( id SERIAL UNIQUE, name varchar(255), email varchar(255), phone varchar(255), constraint pk_contact primary key (id) ); create sequence contact_seq; # --- !Downs drop table if exists contact; drop sequence if exists contact_seq;registro de heroku:
padDefaultDBApi - Database [default] connected at jdbc:postgresql://... !!! WARNING! This script contains DOWNS evolutions that are likely destructive [warn] padeApplicationEvolutions - Your production database [default] needs evolutions, including downs! drop table if exists contact; # --- Rev:1,Downs - a56ada6 name varchar(255), drop sequence if exists contact_seq; email varchar(255), phone varchar(255), # --- Rev:1,Ups - 53110fe create table contact ( ); id SERIAL UNIQUE, constraint pk_contact primary key (id) create sequence contact_seq; [warn] padeApplicationEvolutions - Run with -Dplay.evolutions.db.default.autoApply=true and -Dplay.evolutions.db.default.autoApplyDowns=true if you want to run them automatically, including downs (be careful, especially if your down evolutions drop existing data) [info] application - ApplicationTimer demo: Starting application at 2017-04-28T08:59:05.048Z Oops, cannot start the server. @73o5pe90c: Database 'default' needs evolution!y también agregué play.evolutions.db.default.autoApply=true al final de mi application.conf
Corre con
-Dplay.evolutions.db.default.autoApply=truey
-Dplay.evolutions.db.default.autoApplyDowns=trueSi desea ejecutarlos automáticamente, incluidas las bajas (tenga cuidado, especialmente si sus evoluciones hacia abajo eliminan datos existentes).
Puede configurarlos ejecutando:
heroku config:set JAVA_OPTS="-Dplay.evolutions.db.default.autoApply=true -Dplay.evolutions.db.default.autoApplyDowns=true"