DELIMITER $$ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`ticket_afterDelete` AFTER DELETE ON `ticket` FOR EACH ROW BEGIN INSERT INTO ticketLog SET `action` = 'delete', `changedModel` = 'Ticket', `changedModelId` = OLD.id, `userFk` = account.myUser_getId(); END$$ DELIMITER ;