DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`mailAlias_afterDelete` AFTER DELETE ON `mailAlias` FOR EACH ROW BEGIN INSERT INTO userLog SET `action` = 'delete', `changedModel` = 'MailAlias', `changedModelId` = OLD.id, `userFk` = account.myUser_getId(); END$$ DELIMITER ;