Created
March 7, 2014 15:29
-
-
Save dhrrgn/9413550 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TRIGGER IF EXISTS touch_updated_ones; | |
CREATE TRIGGER touch_updated_ones BEFORE UPDATE ON `super_secret_table_name` | |
FOR EACH ROW SET NEW.touched = UNIX_TIMESTAMP(); | |
DROP TRIGGER IF EXISTS touch_new_ones; | |
CREATE TRIGGER touch_new_ones BEFORE INSERT ON `super_secret_table_name` | |
FOR EACH ROW SET NEW.touched = UNIX_TIMESTAMP(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment