Browse files

Allow illegal length CHAR defaults to be ignored in JdbcModelBuilder

With `ignoreInvalidDefaults = true` all illegal defaults should be
ignored. This was counteracted by throwing a `SlickException` when an
illegal length was detected in `default`. Removing this case makes the
`MatchError` bubble up so it can be either ignored or translated to a
`SlickException` in `convenientDefault`.

Fixes #1104.
  • Loading branch information...
szeiger committed Sep 24, 2015
1 parent 4ba1d10 commit afd6f9bac0e1d727b435a53b982fb452db471294
Showing with 0 additions and 1 deletion.
  1. +0 −1 slick/src/main/scala/slick/jdbc/JdbcModelBuilder.scala
@@ -223,7 +223,6 @@ class JdbcModelBuilder(mTables: Seq[MTable], ignoreInvalidDefaults: Boolean)(imp
v.length match {
case 1 => v(0)
case 3 => v(1) // quoted character
case n => throw new SlickException(s"""Default value "$v" for Char column "$name" has wrong size""")
case (v,"String") if meta.typeName == "CHAR" => v.head // FIXME: check length
case (v,"scala.math.BigDecimal") => v // FIXME: probably we shouldn't use a string here

0 comments on commit afd6f9b

Please sign in to comment.