Mysql Sql Add Created Updated Timestamp To Existing Table

[Solved] Mysql Sql Add Created Updated Timestamp To Existing Table | Sql - Code Explorer | yomemimo.com
Question : mysql sql add created updated timestamp to existing table

Answered by : mushy-meerkat-uxxn9b8muahb

ALTER TABLE t1
ADD COLUMN created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;

Source : https://stackoverflow.com/questions/50603953/how-to-add-created-at-and-updated-at-columns/50604109 | Last Update : Sat, 26 Sep 20

Answers related to mysql sql add created updated timestamp to existing table

Code Explorer Popular Question For Sql