refs #7651 Add editorFk and triggers
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Ivan Mas 2024-07-01 13:26:59 +02:00
parent ac54994760
commit 2ed31ee1d3
3 changed files with 20 additions and 0 deletions

View File

@ -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 ;

View File

@ -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 ;

View File

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