Search
 
SCRIPT & CODE EXAMPLE
 

SQL

ADD COLOUNS CREATED AND UPDATED AT IN MYSQL

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

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;
Comment

PREVIOUS NEXT
Code Example
Sql :: get current date data in mysql 
Sql :: oracle current date plus 1 month 
Sql :: ssh mysql port forwarding 
Sql :: mysql best varchar length size 
Sql :: select from array in psql 
Sql :: sort by last three charecter in sql 
Sql :: sql update alias 
Sql :: copy one column data to another in sql 
Sql :: find nth highest salary of an employee 
Sql :: mysql update inner 
Sql :: how to add not null constraint in sql 
Sql :: string split in sql server 
Sql :: mysql select where text contains 
Sql :: describe table query in postgresql 
Sql :: copy sql table to new table 
Sql :: ms sql truncate table vs delete 
Sql :: grant mysql 
Sql :: oracle create datafile 
Sql :: sql current year 
Sql :: phpmyadmin delete user 
Sql :: sql server current date minus 5 years 
Sql :: mysql remove only_full_group_by permanently 
Sql :: update with join sql server 
Sql :: change default role snowflake 
Sql :: set column to not null mysql 
Sql :: python how escape sql 
Sql :: trigger in postgresql to change incoming entry 
Sql :: copy data from one table column to another table column in sql 
Sql :: how to create enum in postgresql 
Sql :: sql DATE = GETDATE() 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =