Allow zero timestamp default in schema generator

16 views
Skip to first unread message

Ossip Kaehr

unread,
Oct 6, 2016, 1:44:29 PM10/6/16
to Slick / ScalaQuery
Hi
I'm using slick 3.1 with mysql 5.6 , in an existing schema I have a bunch of tables with columns defined like this:

   ts timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'


Note that mysql generates the default value if no default value is given and not first timestamp in a table.
It is not actually a valid timestamp, but works fine within mysql and from other code bases.
In the connection string I use zeroDateTimeBehavior=convertToNull , but that doesn't seem to make a difference here. 

However, slick.codegen.SourceCodeGenerator throws this error: 

   slick.SlickException: Could not parse default value Some(0000-00-00 00:00:00) for column t.ts  ...

Is there any way to avoid this without touching the database and converting the fields to NULLable? 

any suggestions? thanks!
Reply all
Reply to author
Forward
0 new messages