refs #7651 Add editorFk and triggers #2661

Merged
ivanm merged 4 commits from 7651-Add_editorFk_mailAliasAccount into dev 2024-07-02 10:39:55 +00:00
2 changed files with 13 additions and 1 deletions
Showing only changes of commit 29aecd62a5 - Show all commits

View File

@ -0,0 +1,12 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`mailAliasAccount_afterDelete`
AFTER DELETE ON `mailAliasAccount`
FOR EACH ROW
BEGIN
INSERT INTO userLog
SET `action` = 'delete',
`changedModel` = 'MailAliasAccount',
`changedModelId` = OLD.id,
`userFk` = account.myUser_getId();
END$$
DELIMITER ;

View File

@ -1,4 +1,4 @@
ALTER TABLE account.mailAliasAccount ALTER TABLE account.mailAliasAccount
ADD editorFk INT UNSIGNED NULL, ADD editorFk INT(10) UNSIGNED DEFAULT NULL,
ADD CONSTRAINT mailAliasAccount_editorFk FOREIGN KEY (editorFk) ADD CONSTRAINT mailAliasAccount_editorFk FOREIGN KEY (editorFk)
REFERENCES account.`user`(id); REFERENCES account.`user`(id);