Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

add created and updatedAt fields in mysql

ALTER TABLE t1
ADD COLUMN createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN updatedAt DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #created #updatedAt #fields #mysql
ADD COMMENT
Topic
Name
3+1 =