mysql 把timestamp改成datetime,应对2038问题
2024-11-12 田大才子
SELECT CONCAT('ALTER TABLE `', table_name, '` MODIFY `', column_name, '` DATETIME DEFAULT CURRENT_TIMESTAMP;') AS `query`
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = '表名'
AND DATA_TYPE = 'TIMESTAMP';
发表评论: