- CREATE TABLE grade_mod (username varchar(60) ,activity enum('delete','insert','update'), studentid int, assignmentid int, mod_time datetime, primary key(username,datetime));
- CREATE TRIGGER add_value AFTER INSERT ON assignment_score FOR EACH ROW INSERT INTO grade_mod SET activity='insert',studentid=NEW.studentid,assignmentid=NEW.assignmentid,username=USER(),mod_time=NOW();
- CREATE TRIGGER grade_update AFTER UPDATE ON assignment_score FOR EACH ROW INSERT INTO grade_mod SET username=USER(),activity='update',studentid=NEW.studentid,assignmentid=NEW.assignmentid,mod_time=NOW();
- voila, the beginning of an audit trail.
NEXT
PREVIOUS
Master Index