原文地址: https://blog.csdn.net/heatdeath/article/details/79833492

1 `create_time` timestamp not null default current_timestamp comment '创建时间',
2 
3 `update_time` timestamp not null default current_timestamp on update current_timestamp comment '修改时间',

当执行update操作是,并且字段有ON UPDATE CURRENT_TIMESTAMP属性。则字段无论值有没有变化,它的值也会跟着更新为当前UPDATE操作时的时间。


参考资料:

1、timestamp的两个属性:CURRENT_TIMESTAMP 和ON UPDATE CURRENT_TIMESTAMP
https://blog.csdn.net/aitcax/article/details/41849591

相关文章:

  • 2022-03-08
  • 2023-03-21
  • 2022-12-23
  • 2022-02-01
  • 2022-12-23
猜你喜欢
  • 2022-01-29
  • 2021-10-16
  • 2021-08-04
  • 2022-02-23
  • 2021-11-26
相关资源
相似解决方案