I just started using slick with mysql in a new project and I came acress something that just made me meeeh hard…
So I had the following column defined:
… and yes… I defined a custom mapping for Instant, fyi:
After having coded on my boring scala, finatra, slick app for a couple of hours without even compiling because I was just so fucking wired in and everything was just so goddamn going kind of ok… I compiled without any errors (!true story) and had everything running with my shiny new mysql8 db because I am so cutting edge I often give myself paper cuts trying to feel something as I am so far gone……. yeah… and then:
in the goddamn console… I was like: WADU? Y ME? :(
After some googles and overflowing stacks the actual solution is to define the column not as a MySQL TIMESTAMP but a DATETIME. And that is just the shortcut if you do not actually care about the timezone or whatever and just want to store some time that you got from somewhere… which is the case for me… yay!
this is it:
But what is the problem? this helped. I tried to store a time that was before the beginning of mysql timestamp time. Just by 1 fucking second but u kno… time is relative… and money… and sexy? Even the mysql docs reflect this little thingy that is just obvious…