Took me a while to get this right, but here is on delete mysql copy trigger actually works
CREATE TRIGGER CopyOldMedList
BEFORE DELETE ON REF_medications
FOR EACH ROW
insert into REF_medications_old
( `medname` , `order` , `disabled` , `action` )
VALUES
( OLD.medname , OLD.order , NOW() , 'deleted' ) ;
CREATE TRIGGER CopyOldMedList
BEFORE DELETE ON REF_medications
FOR EACH ROW
insert into REF_medications_old
( `medname` , `order` , `disabled` , `action` )
VALUES
( OLD.medname , OLD.order , NOW() , 'deleted' ) ;
Comments
Post a Comment