MySQL auto-store datetime for each row

后端 未结 7 492
醉话见心
醉话见心 2020-12-04 11:33

In MySQL, I\'m sick of adding the columns dt_created and dt_modified (which are date time stamps for creation and last modified respectively) to al

7条回答
  •  佛祖请我去吃肉
    2020-12-04 11:49

    Well, you can't have both:

    mysql doc:

    It is not possible to have the current timestamp be the default value for one column and the auto-update value for another column.

    Sad, isn't it?

    You could however use null instead of now() following this tip

提交回复
热议问题