Skip to content

Instantly share code, notes, and snippets.

@codcodog
Last active June 30, 2020 06:36
Show Gist options
  • Save codcodog/fa2cc31bce83902f2650ce6760237277 to your computer and use it in GitHub Desktop.
Save codcodog/fa2cc31bce83902f2650ce6760237277 to your computer and use it in GitHub Desktop.
Mysql created_at updated_at 字段定义
CREATE TABLE demo (
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment