salix/db/routines/account/triggers/role_afterDelete.sql

13 lines
301 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`role_afterDelete`
AFTER DELETE ON `role`
FOR EACH ROW
BEGIN
INSERT INTO roleLog
SET `action` = 'delete',
`changedModel` = 'Role',
`changedModelId` = OLD.id,
`userFk` = account.myUser_getId();
END$$
DELIMITER ;