首页 > 解决方案 > MySQL | Can not set UTC_TIMESTAMP after ON UPDATE

问题描述

Despite being able to set UTC_TIMESTAMP for:

ALTER TABLE post ADD created_at DATETIME DEFAULT (UTC_TIMESTAMP);

I haven't been able to set UTC_TIMESTAMP for:

ALTER TABLE post ADD updated_at DATETIME ON UPDATE (UTC_TIMESTAMP) AFTER created_at;

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(UTC_TIMESTAMP) AFTER created_at'

标签: mysql

解决方案


推荐阅读