因此,我在Heroku上放置我的遊戲應用時遇到問題在Heroku上部署Play Framework 2.1.1
通過了幾個教程,但無法使其工作。
我的播放應用程序正在顯示,但數據庫沒有被創建。
當我去通過日誌,這是未來
Database 'default' is in inconsistent state
....
Oops, cannot start the server.
.....
ERROR: syntax error at or near "auto_increment"
這是配置:
在application.conf所有數據庫行被註釋掉
1.sql
是一樣的正常(無變化)Procfile是如下
web: target/start -Dhttp.port=${PORT} ${JAVA_OPTS} -DapplyEvolutions.default=true -Ddb.default.driver=org.postgresql.Driver -Ddb.default.url=${DATABASE_URL}
1.SQL的縮短的版本如下(自動生成的)
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table admin (
user_id bigint auto_increment not null,
user_name varchar(255),
user_username varchar(255),
user_password varchar(255),
user_privelege_level integer,
user_type integer,
admin_id bigint,
constraint pk_admin primary key (user_id))
;
# --- a lot more tables
alter table class add constraint fk_class_classteacher_1 foreign key (classteacher_user_id) references teacher (user_id) on delete restrict on update restrict;
create index ix_class_classteacher_1 on class (classteacher_user_id);
# --- a lot more fks and indices
# --- !Downs
SET FOREIGN_KEY_CHECKS=0;
drop table admin;
drop table book;
# --- a lot more drops
SET FOREIGN_KEY_CHECKS=1;
謝謝!卡住幾個小時,更新驅動程序解決了這個問題。 – toidiu