12 lines
286 B
MySQL
12 lines
286 B
MySQL
|
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 ;
|