DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`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 ;