Skip to content

Instantly share code, notes, and snippets.

@Luxato
Last active January 20, 2022 08:37
Show Gist options
  • Save Luxato/9277a827500105fccfd5dad5ac484553 to your computer and use it in GitHub Desktop.
Save Luxato/9277a827500105fccfd5dad5ac484553 to your computer and use it in GitHub Desktop.
Add datetime that updates on update
ALTER TABLE `table_name`
ADD `updated_at` datetime NULL DEFAULT now() on update now();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment