Skip to content

Instantly share code, notes, and snippets.

@ajaydsouza
Last active October 21, 2024 21:24
Show Gist options
  • Save ajaydsouza/be9c6111a06ed550d4fe22cd632810c0 to your computer and use it in GitHub Desktop.
Save ajaydsouza/be9c6111a06ed550d4fe22cd632810c0 to your computer and use it in GitHub Desktop.
WordPress: Set date columns to be CURRENT_TIMESTAMP
ALTER TABLE `wp_posts`
CHANGE `post_date` `post_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE `post_date_gmt` `post_date_gmt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE `post_modified` `post_modified` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE `post_modified_gmt` `post_modified_gmt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment