diff --git a/db/changes/10480-june/00-route.sql b/db/changes/10480-june/00-route.sql deleted file mode 100644 index d48d9475b..000000000 --- a/db/changes/10480-june/00-route.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `vn`.`route` ADD commissionWorkCenterFk INT NULL; -ALTER TABLE `vn`.`route` ADD CONSTRAINT route_FK FOREIGN KEY (commissionWorkCenterFk) REFERENCES vn.workCenter(id) ON DELETE RESTRICT ON UPDATE CASCADE; \ No newline at end of file diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index ebbe9e2de..01708ca69 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2608,7 +2608,6 @@ INSERT INTO `vn`.`workerTimeControlConfig` (`id`, `dayBreak`, `dayBreakDriver`, VALUES (1, 43200, 32400, 129600, 259200, 604800, '', '', 'Leidos.exito', 'Leidos.error', 'timeControl', 5.33, 0.33, 40, '22:00:00', '06:00:00', 57600, 1200, 18000, 57600, 6, 13); -ALTER TABLE `vn`.`routeConfig` ADD defaultWorkCenterFk INT NULL; INSERT INTO `vn`.`routeConfig` (`id`, `defaultWorkCenterFk`) VALUES (1, 9); \ No newline at end of file diff --git a/db/dump/structure.sql b/db/dump/structure.sql index 2c0e8231a..7b9de25e6 100644 --- a/db/dump/structure.sql +++ b/db/dump/structure.sql @@ -34348,6 +34348,7 @@ CREATE TABLE `route` ( `priority` int(11) NOT NULL DEFAULT '0', `invoiceInFk` mediumint(8) unsigned DEFAULT NULL, `beachFk` int(11) DEFAULT NULL, + `commissionWorkCenterFk` int(11) DEFAULT NULL COMMENT 'WorkerCenter que gestiona la ruta', PRIMARY KEY (`id`), KEY `Id_Agencia` (`agencyModeFk`), KEY `Fecha` (`created`), @@ -34356,7 +34357,9 @@ CREATE TABLE `route` ( KEY `fk_route_1_idx` (`zoneFk`), KEY `asdfasdf_idx` (`invoiceInFk`), KEY `route_idxIsOk` (`isOk`), + KEY `route_WorkCenterFk_idx` (`commissionWorkCenterFk`), CONSTRAINT `fk_route_1` FOREIGN KEY (`zoneFk`) REFERENCES `zone` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, + CONSTRAINT `route_WorkCenterFk` FOREIGN KEY (`commissionWorkCenterFk`) REFERENCES `workCenter` (`id`) ON UPDATE CASCADE, CONSTRAINT `route_fk5` FOREIGN KEY (`agencyModeFk`) REFERENCES `agencyMode` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `route_ibfk_1` FOREIGN KEY (`gestdocFk`) REFERENCES `dms` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `route_ibfk_2` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON UPDATE CASCADE, @@ -34513,6 +34516,7 @@ CREATE TABLE `routeConfig` ( `plusCategory1Concept` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `plusCategory2Concept` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, `defaultCompanyFk` smallint(5) unsigned DEFAULT '442', + `defaultWorkCenterFk` int(11) DEFAULT 9 COMMENT 'Para el cálculo de las comisiones, en caso de el creador de la ruta no tenga workCenter', PRIMARY KEY (`id`), KEY `routeConfig_FK` (`defaultCompanyFk`), CONSTRAINT `routeConfig_FK` FOREIGN KEY (`defaultCompanyFk`) REFERENCES `company` (`id`)