Skip to content

Instantly share code, notes, and snippets.

@uncoded-ro
Last active April 5, 2020 21:40
Show Gist options
  • Save uncoded-ro/14aed1c5b9eb1f058bf8dbd44828ec0b to your computer and use it in GitHub Desktop.
Save uncoded-ro/14aed1c5b9eb1f058bf8dbd44828ec0b to your computer and use it in GitHub Desktop.
USE sakila;
DROP TRIGGER IF EXISTS update_after_actor;
DELIMITER $$
CREATE TRIGGER update_after_actor
AFTER UPDATE
ON actor FOR EACH ROW
BEGIN
INSERT INTO actor_log (event, actor_id, first_name, last_name)
VALUES ('update', new.actor_id, new.first_name, new.last_name);
END $$
DELIMITER ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment