column "currency" is of type currency_enum but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Has anybody an idea on how to solve that?
This is a simplified version (I have deleted the rest of the fields...); currency is of type Option[Currency] and it's converted to Option[String].
I'm using 0.9.6-SNAPSHOT and I have defined a KeyedEntityDef for DbPreferences; I have enabled logging and the statement is an update statement so everything is working as expected... but I have got that error:
def modifyPreferences(pref: Preferences): ValidationNEL[String, Preferences] = {
import schema._
pref.id.map(id =>
inTransaction {
val dbpf = DbPreferences(
id,
pref.currency.map(_.code)
)
preferences.insertOrUpdate(dbpf)
}
).toSuccess(
"Preferences instance with invalid ID. Can't be created/modified."
).liftFailNel