我有以下的Postgres列定義:光滑3自動生成的 - 默認值(時間戳)列,如何定義代理商[日期]功能
record_time TIMESTAMP WITHOUT TIME ZONE DEFAULT now()
我怎麼會它映射到華而不實?請考慮,我要映射由now()
函數生成的默認值帳戶
即:
def recordTimestamp: Rep[Date] = column[Date]("record_time", ...???...)
如果有任何額外的定義去那裏的...???...
當前所在?
EDIT(1)
我不想使用
column[Date]("record_time", O.Default(new Date(System.currentTimeMillis()))) // or some such applicative generation of the date column value
參考博客,但它是用於slick2。 slick3方式,同樣來自博客,是:'import slick.profile.SqlProfile.ColumnOption.SqlType' 'def created = column [Timestamp](「created」,SqlType(「timestamp not null default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP」) )' – user2829759