SELECT
CONCAT("UPDATE `",a.TABLE_SCHEMA,"`.`",a.TABLE_NAME,"` SET `",b.COLUMN_NAME,"`='",NOW(),"'; ALTER TABLE `",a.TABLE_SCHEMA,"`.`",a.TABLE_NAME,"` MODIFY `",b.COLUMN_NAME,"` ",b.DATA_TYPE," NOT NULL DEFAULT CURRENT_TIMESTAMP;") AS `script`
FROM
information_schema.TABLES a
JOIN information_schema.COLUMNS b USING(TABLE_NAME)
WHERE
a.TABLE_SCHEMA='db_name' AND
a.TABLE_TYPE ='BASE TABLE' AND
b.DATA_TYPE LIKE '%stamp%'
|