From b8ea54dfc4dc8359f1a258c5b9dafec98fafb4ce Mon Sep 17 00:00:00 2001 From: Bernat Date: Tue, 12 Mar 2019 13:48:25 +0100 Subject: [PATCH] update structure db --- db/install/changes/13-itemLog.sql | 4 ---- db/install/changes/14-basketGetTax.sql | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) delete mode 100644 db/install/changes/13-itemLog.sql create mode 100644 db/install/changes/14-basketGetTax.sql diff --git a/db/install/changes/13-itemLog.sql b/db/install/changes/13-itemLog.sql deleted file mode 100644 index 43a1fcca2..000000000 --- a/db/install/changes/13-itemLog.sql +++ /dev/null @@ -1,4 +0,0 @@ -USE `vn`; - -ALTER TABLE vn.itemLog MODIFY COLUMN userFk int(10) unsigned NULL; -ALTER TABLE vn.itemLog MODIFY COLUMN id int(11) NOT NULL AUTO_INCREMENT; \ No newline at end of file diff --git a/db/install/changes/14-basketGetTax.sql b/db/install/changes/14-basketGetTax.sql new file mode 100644 index 000000000..f74623275 --- /dev/null +++ b/db/install/changes/14-basketGetTax.sql @@ -0,0 +1,21 @@ +DROP procedure IF EXISTS `hedera`.`basketGetTax`; +DELIMITER $$ +CREATE DEFINER=`root`@`%` PROCEDURE `hedera`.`basketGetTax`() + READS SQL DATA +BEGIN +/** + * Returns the taxes for the current client basket. + * + * @treturn tmp.orderTax + */ + DROP TEMPORARY TABLE IF EXISTS tmp.order; + CREATE TEMPORARY TABLE tmp.order + ENGINE = MEMORY + SELECT myBasketGetId() orderFk; + + CALL orderGetTax(); + + DROP TEMPORARY TABLE IF EXISTS tmp.order; +END$$ + +DELIMITER ;