I have class GroupTable that makes schema of table.
As I saw, in other projects there are at conf/evolution/default folder file 1.sql, that is automatically generated from code (as I assume).
But when I start my application - nothing creates.
What should I do? Is it creating automatically or have I write it in my code?
class GroupTable(tag: Tag) extends Table[Group](tag, "groups") {
def name = column[String]("name", O.PrimaryKey)
def day = column[String]("day")
def subject = column[String]("subject")
def typeSub = column[String]("typeSub")
def start = column[Time]("start")
def end = column[Time]("end")
def teacher = column[String]("teacher")
def auditorium = column[Int]("auditorium")
override def * = (name, day, subject, typeSub, start, end, teacher, auditorium) <>((Group.apply _).tupled, Group.unapply)
}
application.conf:
slick.dbs.default.driver = "slick.driver.MySQLDriver$"
slick.dbs.default.db.driver="com.mysql.jdbc.Driver"
slick.dbs.default.db.url="jdbc:mysql://localhost:3306/testdb"
slick.dbsdefault.user="root"
slick.dbs.default.password=""
play.evolutions.autoApply=true
evolutionplugin=enabled
play.evolutions.db.default.autoApply=true
play.evolutions.db.default.autoApplyDowns=true
built.sbt:
name := "TimetableAPI"
version := "1.0"
lazy val `timetableapi` = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.7"
libraryDependencies ++= Seq(cache, ws, specs2 % Test, evolutions,
"mysql" % "mysql-connector-java" % "5.1.34",
"com.typesafe.play" %% "play-slick" % "1.1.0",
"com.typesafe.play" %% "play-slick-evolutions" % "1.1.0")
unmanagedResourceDirectories in Test <+= baseDirectory(_ / "target/web/public/test")
resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases"
routesGenerator := InjectedRoutesGenerator