Skip to content

Instantly share code, notes, and snippets.

@yappo
Last active September 18, 2015 07:07
Show Gist options
  • Save yappo/b652c742507f7f1a20b7 to your computer and use it in GitHub Desktop.
Save yappo/b652c742507f7f1a20b7 to your computer and use it in GitHub Desktop.
LOCK TABLES lovecall WRITE, dropdb WRITE;
DROP TRIGGER lovecall_counter;
DELIMITER |
CREATE TRIGGER lovecall_counter AFTER INSERT ON lovecall FOR EACH ROW
BEGIN
UPDATE counter SET lovecall_count = lovecall_count + 1;
UPDATE dropdb SET lovecall_count = lovecall_count + 1;
END;
|
DELIMITER ;
UNLOCK TABLES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment