原文地址: 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