2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`itemShelving_beforeUpdate`
|
2024-01-15 11:31:03 +00:00
|
|
|
BEFORE UPDATE ON `itemShelving`
|
|
|
|
FOR EACH ROW
|
|
|
|
BEGIN
|
2024-04-03 05:04:12 +00:00
|
|
|
|
2024-01-25 16:33:54 +00:00
|
|
|
SET NEW.editorFk = account.myUser_getId();
|
2024-01-15 11:31:03 +00:00
|
|
|
IF NEW.userFk IS NULL THEN
|
|
|
|
SET NEW.userFk = account.myUser_getId();
|
|
|
|
END IF;
|
2024-04-03 05:04:12 +00:00
|
|
|
|
2024-10-07 07:05:03 +00:00
|
|
|
IF NEW.shelvingFk <> OLD.shelvingFk THEN
|
2024-10-07 11:46:56 +00:00
|
|
|
SET NEW.movingState = NULL;
|
2024-10-07 07:05:03 +00:00
|
|
|
END IF;
|
2024-01-15 11:31:03 +00:00
|
|
|
END$$
|
|
|
|
DELIMITER ;
|