原文地址: https://blog.csdn.net/heatdeath/article/details/79833492spa
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操做时的时间。.net
参考资料:code
一、timestamp的两个属性:CURRENT_TIMESTAMP 和ON UPDATE CURRENT_TIMESTAMP
http://www.javashuo.com/article/p-sjvhdiju-km.htmlblog