sql - Mysql auto-initialization of timestamp column when adding it to an existent table -
sql - Mysql auto-initialization of timestamp column when adding it to an existent table -
i want add together column table maintain track of when each record lastly updated. have info in table.
the sql query running this:
alter table `my_table` add together column `last_modified` timestamp not null default current_timestamp on update current_timestamp`;
when adding columns of other types existent records default value specify column. in case existent records getting assigned value of: 0000-00-00 00:00:00
why happening if explicitly said wanted default current timestamp?
mysql sql timestamp
Comments
Post a Comment