举个例子:

mysql数据库中有两个字段publication_time、storage_time,我尝试着一个一个的修改字段的状态

#alter table books modify column `storage_time` timestamp default current_timestamp;
#alter table books modify column `publication_time` set default current_timestamp;

结果总是出问题,后来改成一块儿修改就没问题了:

#alter table books modify column `publication_time` timestamp default current_timestamp not null, modify column `storage_time` timestamp default current_timestamp not null;

 

相关文章:

  • 2021-12-24
  • 2021-08-24
  • 2021-06-29
  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2021-05-12
  • 2021-06-24
  • 2021-07-08
  • 2021-11-21
相关资源
相似解决方案