数据库“默认”处于不一致状态

时间:2019-07-19 11:12:48

标签: playframework ebean playframework-evolutions

我使用的是Play框架2.7.3,无论我做什么,进化总是创建错误的sql

我试图编辑生成的sql,但是在加载项目后,演化就变成了以前的方式

这是在我的application.conf中

db.default.url="jdbc:mysql://localhost:3306/playstudent?serverTimezone=EST5EDT"
db.default.username=root
ebean.default = ["models.*"]

#my build.sbt look like this
#=============================


name := """MyFirstPlay"""
organization := "com.example"

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean)

scalaVersion := "2.13.0"
libraryDependencies ++= Seq(evolutions, jdbc)
libraryDependencies += guice
libraryDependencies += jdbc
libraryDependencies += javaJdbc
libraryDependencies += javaWs

// https://mvnrepository.com/artifact/mysql/mysql-connector-java
libraryDependencies += "mysql" % "mysql-connector-java" % "8.0.16"

libraryDependencies += "javax.xml.bind" % "jaxb-api" % "2.3.1"
libraryDependencies += "javax.activation" % "activation" % "1.1.1"
libraryDependencies += "org.glassfish.jaxb" % "jaxb-runtime" % "2.3.2"



playEbeanModels in Compile := Seq("models.*")
playEbeanDebugLevel := 4

我期望生成的sql是正确的,但是出现此错误

play.api.db.evolutions.InconsistentDatabase:数据库“默认”处于不一致状态![未正确应用演变。请检查问题并  将其标记为已解决之前,请手动解决。]         在play.api.db.evolutions.DatabaseEvolutions。$ anonfun $ checkEvolutionsState $ 3(EvolutionsApi.scala:309)         at play.api.db.evolutions.DatabaseEvolutions。$ anonfun $ checkEvolutionsState $ 3 $ adapted(EvolutionsApi.scala:294)         在play.api.db.evolutions.DatabaseEvolutions.executeQuery(EvolutionsApi.scala:341)         在play.api.db.evolutions.DatabaseEvolutions.checkEvolutionsState(EvolutionsApi.scala:294)         在play.api.db.evolutions.DatabaseEvolutions.databaseEvolutions(EvolutionsApi.scala:145)         在play.api.db.evolutions.DatabaseEvolutions.scripts(EvolutionsApi.scala:120)         在play.api.db.evolutions.DatabaseEvolutions.scripts(EvolutionsApi.scala:135)         在play.api.db.evolutions.DefaultEvolutionsApi.scripts(EvolutionsApi.scala:99)         在play.api.db.evolutions.ApplicationEvolutions $。$ anonfun $ runEvolutions $ 1(ApplicationEvolutions.scala:206)         在play.api.db.evolutions.ApplicationEvolutions $ .withLock(ApplicationEvolutions.scala:232) [错误]应用程序-

! @ 7ch9a8n6b-内部服务器错误,用于(GET)[/]->

play.api.db.evolutions.InconsistentDatabase:数据库“默认”处于不一致状态![未正确应用演变。请检查问题并  将其标记为已解决之前,请手动解决。]         在play.api.db.evolutions.DatabaseEvolutions。$ anonfun $ checkEvolutionsState $ 3(EvolutionsApi.scala:309)         at play.api.db.evolutions.DatabaseEvolutions。$ anonfun $ checkEvolutionsState $ 3 $ adapted(EvolutionsApi.scala:294)         在play.api.db.evolutions.DatabaseEvolutions.executeQuery(EvolutionsApi.scala:341)         在play.api.db.evolutions.DatabaseEvolutions.checkEvolutionsState(EvolutionsApi.scala:294)         在play.api.db.evolutions.DatabaseEvolutions.databaseEvolutions(EvolutionsApi.scala:145)         在play.api.db.evolutions.DatabaseEvolutions.scripts(EvolutionsApi.scala:120)         在play.api.db.evolutions.DatabaseEvolutions.scripts(EvolutionsApi.scala:135)         在play.api.db.evolutions.DefaultEvolutionsApi.scripts(EvolutionsApi.scala:99)         在play.api.db.evolutions.ApplicationEvolutions $。$ anonfun $ runEvolutions $ 1(ApplicationEvolutions.scala:206)         在play.api.db.evolutions.ApplicationEvolutions $ .withLock(ApplicationEvolutions.scala:232)

0 个答案:

没有答案