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

12 lines
286 B
MySQL
Raw Permalink Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`role_beforeUpdate`
BEFORE UPDATE ON `role`
FOR EACH ROW
BEGIN
SET NEW.editorFk = account.myUser_getId();
IF !(NEW.`name` <=> OLD.`name`) THEN
CALL role_checkName (NEW.`name`);
END IF;
END$$
DELIMITER ;