diff --git a/services/db/install/changes/1.2-CHECK/04-itemCategory.sql b/services/db/install/changes/1.2-CHECK/01-itemCategory.sql similarity index 100% rename from services/db/install/changes/1.2-CHECK/04-itemCategory.sql rename to services/db/install/changes/1.2-CHECK/01-itemCategory.sql diff --git a/services/db/install/changes/1.2-CHECK/02-clentLog.sql b/services/db/install/changes/1.2-CHECK/02-clentLog.sql new file mode 100644 index 000000000..76ba2a65d --- /dev/null +++ b/services/db/install/changes/1.2-CHECK/02-clentLog.sql @@ -0,0 +1,2 @@ +ALTER TABLE `vn`.`clientLog` +CHANGE COLUMN `newInstance` `newInstance` TEXT NULL DEFAULT NULL ; diff --git a/services/db/install/changes/1.2-CHECK/03-clientLogBeforeInsert.sql b/services/db/install/changes/1.2-CHECK/03-clientLogBeforeInsert.sql new file mode 100644 index 000000000..357f2a80d --- /dev/null +++ b/services/db/install/changes/1.2-CHECK/03-clientLogBeforeInsert.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 ;