herokuでjava(spring)アプリケーションを作成し、postgresqlに接続しました。私はアプリのリクエストを行うと、ログがorg.postgresql.util.PSQLException:ERROR:relation "dish"が存在しません
WARN 4 --- [io-14883-exec-3] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 42P01 app[web.1]: 2016-12-11 12:13:09.942 ERROR 4 --- [io-14883-exec-3] o.h.engine.jdbc.spi.SqlExceptionHelper : ERROR: relation "dish" does not exist app[web.1]: Position: 13 app[web.1]: 2016-12-11 12:13:10.031 ERROR 4 --- [io-14883-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute statement] with root cause app[web.1]: org.postgresql.util.PSQLException: ERROR: relation "dish" does not exist app[web.1]: Position: 13
application.propertiesを示しています。
spring.datasource.url=${JDBC_DATABASE_URL}
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.maxActive=10
spring.datasource.maxIdle=5
spring.datasource.minIdle=2
spring.datasource.initialSize=5
spring.datasource.removeAbandoned=true
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.generate-ddl=false
#spring.jpa.hibernate.ddl-auto=create
spring.jpa.show-sql=true
このモデルは私のローカルマシン上で動作し
モデル:
@Entity
public class Dish
implements Serializable
{
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long dishId;
private Long categoryId;
private String name;
private String description;
private Float price;
private String picUrl;
public Long getId()
{
return this.dishId;
}
public void setId(Long dishId)
{
this.dishId = dishId;
}
public Long getCategoryId()
{
return this.categoryId;
}
public void setCategoryId(Long categoryId)
{
this.categoryId = categoryId;
}
public String getName()
{
return this.name;
}
public void setName(String name)
{
this.name = name;
}
public String getDescription()
{
return this.description;
}
public void setDescription(String description)
{
this.description = description;
}
public Float getPrice()
{
return this.price;
}
public void setPrice(Float price)
{
this.price = price;
}
public String getPicUrl()
{
return this.picUrl;
}
public void setPicUrl(String picUrl)
{
this.picUrl = picUrl;
}
}
だから、料理という名前のテーブルはありません。ここで問題はどこですか? –
@CraigRinger MR CAP))私はそれを知っています、私の質問はなぜですか?私は自分のローカルマシンで酔っ払っていたが、英雄をやる –