I have a database schema defined in mySQL already and I want to work on the play-2 with ActiveRecord application on top of it.
However, when I start up the project, it gives me error:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'user' already exists
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'user' already exists
and it is triggered by
org.squeryl.Schema.create(Schema.scala:181)
models.Tables$.initialize(Tables.scala:7)
This is how it looks in my Tables.scala
object Tables extends ActiveRecordTables with PlaySupport {
val users = table[User]
}
and my User.scala is:
case class User(
override val id: Long,
@Length(max=50) login: String
) extends ActiveRecord {
lazy val role = belongsTo[Role]
}
object User extends ActiveRecordCompanion[User]
I tried to skip this in my global.scala
override def onStart(app: Application) {
//Tables.initialize
}
However, it still give me the same error
Is that anyway I can bypass the create table part?
Many thanks!