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 :: find column in all stored procedures sql server 
Sql :: alter user mysql native password 
Sql :: GROUP BY clause; this is incompatible with sql_mode=only_full_group_by 
Sql :: oracle all tables in schema 
Sql :: running query in redshift 
Sql :: Failed to stop mysqld.service: Unit mysqld.service not loaded. 
Sql :: drop stored procedure mysql 
Sql :: Enter into postgresql database,create user and grant Access 
Sql :: print in pl sql 
Sql :: mysql 3 months ago 
Sql :: postgresql generate uuid 
Sql :: too many connections mysql 
Sql :: sql drop table if exists 
Sql :: how to get all tables in sql 
Sql :: query to find table size in oracle 12c 
Sql :: pdo mysql insert 
Sql :: mysql select random id from table 
Sql :: sql server list table sizes 
Sql :: oracle sql drop index 
Sql :: drush sql-dump 
Sql :: if date is today mysql 
Sql :: mysql connection with sqlalchecmy 
Sql :: cast to date bigquery 
Sql :: Check Table Exists 
Sql :: oracle sleep 
Sql :: The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement 
Sql :: oracle next run dates 
Sql :: sql getdate minus 1 day without time 
Sql :: autocommit mysql 
Sql :: left join with only first record 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =