Merge pull request 'refs #7651 Add editorFk and triggers' (!2661) from 7651-Add_editorFk_mailAliasAccount into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2661 Reviewed-by: Guillermo Bonet <guillermo@verdnatura.es>
This commit is contained in:
commit
4ad6c440e0
|
@ -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 ;
|
|
@ -0,0 +1,8 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`mailAliasAccount_beforeInsert`
|
||||||
|
BEFORE INSERT ON `mailAliasAccount`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -0,0 +1,8 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`mailAliasAccount_beforeUpdate`
|
||||||
|
BEFORE UPDATE ON `mailAliasAccount`
|
||||||
|
FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -0,0 +1,4 @@
|
||||||
|
ALTER TABLE account.mailAliasAccount
|
||||||
|
ADD editorFk INT(10) UNSIGNED DEFAULT NULL,
|
||||||
|
ADD CONSTRAINT mailAliasAccount_editorFk FOREIGN KEY (editorFk)
|
||||||
|
REFERENCES account.`user`(id);
|
Loading…
Reference in New Issue