17 lines
385 B
MySQL
17 lines
385 B
MySQL
|
DELIMITER $$
|
||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`user_beforeUpdate`
|
||
|
BEFORE UPDATE ON `user`
|
||
|
FOR EACH ROW
|
||
|
BEGIN
|
||
|
SET NEW.editorFk = account.myUser_getId();
|
||
|
|
||
|
IF !(NEW.`name` <=> OLD.`name`) THEN
|
||
|
CALL user_checkName (NEW.`name`);
|
||
|
END IF;
|
||
|
|
||
|
IF !(NEW.`password` <=> OLD.`password`) THEN
|
||
|
SET NEW.lastPassChange = util.VN_NOW();
|
||
|
END IF;
|
||
|
END$$
|
||
|
DELIMITER ;
|