How to define current timestamp in yaml with doctrine?

前端 未结 7 1100
灰色年华
灰色年华 2020-12-09 18:41

I tried the following yaml code:

columns:
  created_time:
    type: timestamp
    notnull: true
    default: default CURRENT_TIMESTAMP

In

7条回答
  •  暖寄归人
    2020-12-09 19:04

    You could use the 'Timestampable' functionality in doctrine, eg:

    actAs:
      Timestampable:
        created:
          name: created_time
        updated:
          disabled: true
    columns:
      created_time:
        type: timestamp
       notnull: true
    

提交回复
热议问题