Skip to content

Instantly share code, notes, and snippets.

@d3ep4k
Created June 21, 2017 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d3ep4k/e8a0542192167507a71e7250a5a8d021 to your computer and use it in GitHub Desktop.
Save d3ep4k/e8a0542192167507a71e7250a5a8d021 to your computer and use it in GitHub Desktop.
Create Table with update and create timestamp
CREATE TABLE `msgs` (
`id` INT PRIMARY KEY AUTO_INCREMENT,
`msg` VARCHAR(256),
`ts_create` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`ts_update` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment