Yaneeve Yaneeve - 18 days ago 7
Scala Question

slick 3 auto-generated - default value (timestamp) column, how to define a Rep[Date] function

I have the following postgres column definition:

record_time TIMESTAMP WITHOUT TIME ZONE DEFAULT now()


How would I map it to slick? Please take into account that I wish to map the default value generated by the
now()
function

i.e:

def recordTimestamp: Rep[Date] = column[Date]("record_time", ...???...)


Should any extra definition go where the
...???...
is currently located?

EDIT (1)

I do not want to use

column[Date]("record_time", O.Default(new Date(System.currentTimeMillis()))) // or some such applicative generation of the date column value

Answer

I guess this is not supported yet. Here is issue: https://github.com/slick/slick/issues/214