【Mysql】Mysql 5.7给表添加创建时间和更新时间

Mysql 5.7给表添加创建时间和更新时间

    alter table `table_name` add column create_time timestamp not null default current_timestamp;
    alter table `table_name` add column update_time timestamp not null default current_timestamp on update current_timestamp;

猜你喜欢

转载自blog.csdn.net/linjiuxiansheng/article/details/130072564