Inserting default values if column value is 'None' using slick

前端 未结 2 1856
暗喜
暗喜 2021-01-18 02:08

My problem is simple.

I have a column seqNum: Double which is NOT NULL DEFAULT 1 in CREATE TABLE statement as follows:

<
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-18 02:26

    Either you enforce the Option passed to Slick by suffixing it with a .getOrElse(theDefault), or you make the DB accepts NULL (from a None value) and defaults it using some trigger.

提交回复
热议问题