explicit_defaults_for_timestamp不为1的情况

  • 如果表中的timestamp列没有被显式指定null属性,那么该列会被自动加上not null属性。
  • 如果尝试往这一列插入null值,会被自动修改为 current timestamp。
  • 表中的第一个timestamp列,如果没有显式指定null属性或指定默认值,也没有指定 on update语句,那么就会被自动加上 default current_timestamp 和 on update current_timestamp属性。
  • 第一个timestamp列之后的其他timestamp类型的列,如果没有显式指定null属性或指定默认值,那么会被自动加上 default ‘0000-00-00 00:00:00’属性。如果insert语句中没有为该列指定值,那么该列中插入’0000-00-00 00:00:00’,且没有warning。