diff --git a/db/install/changes/1-orderGetTotal.sql b/db/install/changes/1-orderGetTotal.sql index dbbc990f2..9c47db108 100644 --- a/db/install/changes/1-orderGetTotal.sql +++ b/db/install/changes/1-orderGetTotal.sql @@ -1,10 +1,7 @@ -USE `hedera`; -DROP procedure IF EXISTS `orderGetTotal`; +DROP procedure IF EXISTS `hedera`.`orderGetTotal`; DELIMITER $$ -USE `hedera`$$ - -CREATE DEFINER=`root`@`%` PROCEDURE `orderGetTotal`() +CREATE DEFINER=`root`@`%` PROCEDURE `hedera`.`orderGetTotal`() BEGIN /** * Calcula el total con IVA para un conjunto de orders. diff --git a/db/install/changes/12-ticketGetProblems.sql b/db/install/changes/12-ticketGetProblems.sql index 29bd3e93a..9f937ba8d 100644 --- a/db/install/changes/12-ticketGetProblems.sql +++ b/db/install/changes/12-ticketGetProblems.sql @@ -5,12 +5,12 @@ DELIMITER $$ USE `vn`$$ CREATE DEFINER=`root`@`%` PROCEDURE `ticketGetProblems`() BEGIN -/* - * Obtiene los problemas de uno o varios tickets - * - * @table tmp.ticketGetProblems(ticketFk, clientFk, warehouseFk, shipped) - * @return tmp.ticketProblems - */ +/** + * Obtiene los problemas de uno o varios tickets + * + * @table tmp.ticketGetProblems(ticketFk, clientFk, warehouseFk, shipped) + * @return tmp.ticketProblems + */ DECLARE vWarehouse INT; DECLARE vDate DATE; DECLARE vAvailableCache INT; diff --git a/db/install/changes/16-itemLog.sql b/db/install/changes/16-itemLog.sql new file mode 100644 index 000000000..f6d028dab --- /dev/null +++ b/db/install/changes/16-itemLog.sql @@ -0,0 +1,16 @@ +ALTER TABLE `vn`.`itemLog` +CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT , +ADD PRIMARY KEY (`id`); + + +ALTER TABLE `vn`.`itemLog` +DROP FOREIGN KEY `itemLogUserFk`; +ALTER TABLE `vn`.`itemLog` +CHANGE COLUMN `id` `id` INT(11) NOT NULL AUTO_INCREMENT , +CHANGE COLUMN `userFk` `userFk` INT(10) UNSIGNED NULL DEFAULT NULL ; +ALTER TABLE `vn`.`itemLog` +ADD CONSTRAINT `itemLogUserFk` + FOREIGN KEY (`userFk`) + REFERENCES `account`.`user` (`id`) + ON DELETE CASCADE + ON UPDATE CASCADE; diff --git a/db/install/changes/7-clientAfterInsert.sql b/db/install/changes/7-clientAfterInsert.sql index 2c9033b31..b8b51b5c5 100644 --- a/db/install/changes/7-clientAfterInsert.sql +++ b/db/install/changes/7-clientAfterInsert.sql @@ -1,3 +1,3 @@ /* Añadir a producción cuando se suba salix */ -DROP TRIGGER vn2008.ClientesAfterInsert; +DROP TRIGGER IF EXISTS vn2008.ClientesAfterInsert;