-
-
Save FerraBraiZ/1641d8aff3a211954da81a788991f3cb to your computer and use it in GitHub Desktop.
MySQL - 5.6.5 2, 2 TIMESTAMP column / CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause? | |
in MySQL 5.6.5 (2012-04-10, Milestone 8) is possible to have 2 fields, as follows: | |
CREATE TABLE `foo` ( | |
`id` INT(10) UNSIGNED NOT NULL, | |
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
`updated_at ` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP | |
) ENGINE=INNODB; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment