Created
July 18, 2011 23:33
-
-
Save alegomes/1090952 to your computer and use it in GitHub Desktop.
Auditing dotProject (2.1-rc2) task_log records
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
-- MySQL 5.0 | |
alter table task_log add column task_log_created datetime default '1900-01-01 00:00:00'; | |
delimiter // | |
CREATE TRIGGER task_log_created_trigger BEFORE INSERT ON task_log | |
FOR EACH ROW | |
BEGIN | |
IF NEW.task_log_created = "1900-01-01 00:00:00" THEN | |
SET NEW.task_log_created = NOW(); | |
END IF; | |
END;// | |
delimiter ; | |
alter table task_log add column task_log_modified timestamp default current_timestamp on update current_timestamp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment