Permalink
Browse files

Ignore sqlite indices generated by autoindex feature.

This started breaking the tests when upgrading from org.xerial:sqlite-jdbc:3.8.7 to 3.8.11.2
But since they are automatically generated by sqlite it sort of makes sense not to put them into slick's
schema, so it doesn't try to create them. One might argue differently. We can change our minds in the
future if we need to.
  • Loading branch information...
1 parent 6c638ea commit 557866266c8cefdcf585f131eed8bbb613068924 @cvogt cvogt committed Jun 20, 2016
Showing with 6 additions and 1 deletion.
  1. +1 −1 project/Build.scala
  2. +5 −0 slick/src/main/scala/slick/jdbc/SQLiteProfile.scala
View
@@ -37,7 +37,7 @@ object SlickBuild extends Build {
val h2 = "com.h2database" % "h2" % "1.4.191"
val testDBs = Seq(
h2,
- "org.xerial" % "sqlite-jdbc" % "3.8.7",
+ "org.xerial" % "sqlite-jdbc" % "3.8.11.2",
"org.apache.derby" % "derby" % "10.9.1.0",
"org.hsqldb" % "hsqldb" % "2.2.8",
"postgresql" % "postgresql" % "9.1-901.jdbc4",
@@ -120,6 +120,11 @@ trait SQLiteProfile extends JdbcProfile {
// in 3.7.15-M1:
override def columns = super.columns.map(_.stripPrefix("\"").stripSuffix("\""))
}
+ override def readIndices(t: MTable) = super.readIndices(t).map(
+ _.filterNot(
+ _.exists( _.indexName.exists(_.startsWith("sqlite_autoindex_")) )
+ )
+ )
}
override def createModelBuilder(tables: Seq[MTable], ignoreInvalidDefaults: Boolean)(implicit ec: ExecutionContext): JdbcModelBuilder =

0 comments on commit 5578662

Please sign in to comment.