Skip to content

Instantly share code, notes, and snippets.

@ianldgs
Last active April 16, 2018 16:53
Show Gist options
  • Save ianldgs/aee4f3d968d54ee8d398 to your computer and use it in GitHub Desktop.
Save ianldgs/aee4f3d968d54ee8d398 to your computer and use it in GitHub Desktop.
Cancel delete mysql
DELIMITER |
CREATE TRIGGER cancel_delete BEFORE DELETE ON table
FOR EACH ROW
BEGIN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'DELETE canceled';
END |
DELIMITER ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment