diff --git a/db/routines/vn/triggers/itemMinimumQuantity_afterDelete.sql b/db/routines/vn/triggers/itemMinimumQuantity_afterDelete.sql new file mode 100644 index 000000000..1da5a5942 --- /dev/null +++ b/db/routines/vn/triggers/itemMinimumQuantity_afterDelete.sql @@ -0,0 +1,12 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemMinimumQuantity_afterDelete` + AFTER DELETE ON `itemMinimumQuantity` + FOR EACH ROW +BEGIN + INSERT INTO itemLog + SET `action` = 'delete', + `changedModel` = 'ItemMinimumQuantity', + `changedModelId` = OLD.id, + `userFk` = account.myUser_getId(); +END$$ +DELIMITER ; diff --git a/db/routines/vn/triggers/itemShelving _afterDelete.sql b/db/routines/vn/triggers/itemShelving _afterDelete.sql index 7c0d54358..9a1759eff 100644 --- a/db/routines/vn/triggers/itemShelving _afterDelete.sql +++ b/db/routines/vn/triggers/itemShelving _afterDelete.sql @@ -1,5 +1,5 @@ DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelving _afterDelete` +CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelving_afterDelete` AFTER DELETE ON `itemShelving` FOR EACH ROW BEGIN diff --git a/db/versions/11149-silverSalal/00-firstScript.sql b/db/versions/11149-silverSalal/00-firstScript.sql index a53911f37..e642dd2e4 100644 --- a/db/versions/11149-silverSalal/00-firstScript.sql +++ b/db/versions/11149-silverSalal/00-firstScript.sql @@ -25,3 +25,6 @@ CREATE TABLE `vn`.`itemMinimumQuantity` ( GRANT SELECT, UPDATE, DELETE, INSERT ON TABLE vn.itemMinimumQuantity TO buyer; GRANT EXECUTE ON PROCEDURE vn.ticketCalculatePurge TO guest; + +ALTER TABLE vn.itemLog MODIFY COLUMN changedModel enum('Item','ItemBarcode','ItemBotanical','ItemNiche','ItemTag','ItemTaxCountry','ItemMinimumQuantity') + CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT 'Item' NOT NULL; diff --git a/modules/item/back/models/item-minimum-quantity.json b/modules/item/back/models/item-minimum-quantity.json index 7acbb5c6f..74eac39fc 100644 --- a/modules/item/back/models/item-minimum-quantity.json +++ b/modules/item/back/models/item-minimum-quantity.json @@ -6,6 +6,9 @@ "table": "itemMinimumQuantity" } }, + "mixins": { + "Loggable": true + }, "properties": { "id": { "type": "number",