DELIMITER $$ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`itemShelving_beforeDelete` BEFORE DELETE ON `itemShelving` FOR EACH ROW INSERT INTO vn.itemShelvingLog(itemShelvingFk, workerFk, accion, shelvingFk, itemFk) VALUES( OLD.id, account.myUser_getId(), 'ELIMINADO', OLD.shelvingFk, OLD.itemFk)$$ DELIMITER ;