Created
March 14, 2023 16:29
-
-
Save dr-skot/535572b05d08b71e419853849fd81fde to your computer and use it in GitHub Desktop.
MySQL CREATE TABLE syntax for automatic creation-time and modification-time columns
This file contains 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
CREATE TABLE `database-name`.`table-name`( | |
... | |
`created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
`modified` 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