DELIMITER $$ CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` TRIGGER `vn`.`rate_afterDelete` AFTER DELETE ON `rate` FOR EACH ROW BEGIN INSERT INTO rateLog SET `action` = 'delete', `changedModel` = 'Rate', `changedModelId` = OLD.id, `userFk` = account.myUser_getId(); END$$ DELIMITER ;