From 5480c5bdbfc396e513cc94b12e8049e5cea34137 Mon Sep 17 00:00:00 2001 From: Bernat Date: Mon, 29 Oct 2018 11:35:17 +0100 Subject: [PATCH] update structure table logs --- .../changes/1.2-CHECK/02-beforeInsertItemLog.sql | 11 +++++++++++ .../changes/1.2-CHECK/03-beforeInsertClientLog.sql | 11 +++++++++++ .../changes/1.2-CHECK/05-beforeInsertClaimLog.sql | 11 +++++++++++ .../changes/1.2-CHECK/06-beforeInsertTicketLog.sql | 11 +++++++++++ 4 files changed, 44 insertions(+) create mode 100644 services/db/install/changes/1.2-CHECK/02-beforeInsertItemLog.sql create mode 100644 services/db/install/changes/1.2-CHECK/03-beforeInsertClientLog.sql create mode 100644 services/db/install/changes/1.2-CHECK/05-beforeInsertClaimLog.sql create mode 100644 services/db/install/changes/1.2-CHECK/06-beforeInsertTicketLog.sql diff --git a/services/db/install/changes/1.2-CHECK/02-beforeInsertItemLog.sql b/services/db/install/changes/1.2-CHECK/02-beforeInsertItemLog.sql new file mode 100644 index 000000000..f3e9c6f4a --- /dev/null +++ b/services/db/install/changes/1.2-CHECK/02-beforeInsertItemLog.sql @@ -0,0 +1,11 @@ +DROP TRIGGER IF EXISTS `vn`.`itemLog_BEFORE_INSERT`; + +DELIMITER $$ +USE `vn`$$ +CREATE DEFINER=`root`@`%` TRIGGER `vn`.`itemLog_BEFORE_INSERT` BEFORE INSERT ON `itemLog` FOR EACH ROW +BEGIN + IF NEW.newInstance is NULL THEN + SET NEW.newInstance = NEW.description; + END IF; +END$$ +DELIMITER ; diff --git a/services/db/install/changes/1.2-CHECK/03-beforeInsertClientLog.sql b/services/db/install/changes/1.2-CHECK/03-beforeInsertClientLog.sql new file mode 100644 index 000000000..ec6b31e76 --- /dev/null +++ b/services/db/install/changes/1.2-CHECK/03-beforeInsertClientLog.sql @@ -0,0 +1,11 @@ +DROP TRIGGER IF EXISTS `vn`.`ticketLog_BEFORE_INSERT`; + +DELIMITER $$ +USE `vn`$$ +CREATE DEFINER=`root`@`%` TRIGGER `vn`.`ticketLog_BEFORE_INSERT` BEFORE INSERT ON `ticketLog` FOR EACH ROW +BEGIN + IF NEW.newInstance is NULL THEN + SET NEW.newInstance = NEW.description; + END IF; +END$$ +DELIMITER ; diff --git a/services/db/install/changes/1.2-CHECK/05-beforeInsertClaimLog.sql b/services/db/install/changes/1.2-CHECK/05-beforeInsertClaimLog.sql new file mode 100644 index 000000000..37fa97755 --- /dev/null +++ b/services/db/install/changes/1.2-CHECK/05-beforeInsertClaimLog.sql @@ -0,0 +1,11 @@ +DROP TRIGGER IF EXISTS `vn`.`claimLog_BEFORE_INSERT`; + +DELIMITER $$ +USE `vn`$$ +CREATE DEFINER=`root`@`%` TRIGGER `vn`.`claimLog_BEFORE_INSERT` BEFORE INSERT ON `claimLog` FOR EACH ROW +BEGIN + IF NEW.newInstance is NULL THEN + SET NEW.newInstance = NEW.description; + END IF; +END$$ +DELIMITER ; diff --git a/services/db/install/changes/1.2-CHECK/06-beforeInsertTicketLog.sql b/services/db/install/changes/1.2-CHECK/06-beforeInsertTicketLog.sql new file mode 100644 index 000000000..357f2a80d --- /dev/null +++ b/services/db/install/changes/1.2-CHECK/06-beforeInsertTicketLog.sql @@ -0,0 +1,11 @@ +DROP TRIGGER IF EXISTS `vn`.`clientLog_BEFORE_INSERT`; + +DELIMITER $$ +USE `vn`$$ +CREATE DEFINER=`root`@`%` TRIGGER `vn`.`clientLog_BEFORE_INSERT` BEFORE INSERT ON `clientLog` FOR EACH ROW +BEGIN + IF NEW.newInstance is NULL THEN + SET NEW.newInstance = NEW.description; + END IF; +END$$ +DELIMITER ;