diff --git a/db/routines/vn2008/triggers/movement_label_afterUpdate.sql b/db/routines/vn2008/triggers/movement_label_afterUpdate.sql deleted file mode 100644 index 364568fb3..000000000 --- a/db/routines/vn2008/triggers/movement_label_afterUpdate.sql +++ /dev/null @@ -1,8 +0,0 @@ -DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn2008`.`movement_label_afterUpdate` - AFTER UPDATE ON `movement_label` - FOR EACH ROW -IF NEW.stem >= (SELECT Cantidad FROM Movimientos WHERE Id_Movimiento = NEW.Id_Movimiento) THEN - UPDATE Movimientos SET OK = 1 WHERE Id_Movimiento = NEW.Id_Movimiento; -END IF$$ -DELIMITER ; diff --git a/db/routines/vn2008/views/Rutas_Master b/db/routines/vn2008/views/Rutas_Master deleted file mode 100644 index 03b9cfc21..000000000 --- a/db/routines/vn2008/views/Rutas_Master +++ /dev/null @@ -1,24 +0,0 @@ - -CREATE OR REPLACE DEFINER = `root`@`localhost` - SQL SECURITY DEFINER - VIEW `vn2008`.`Rutas_Master` -AS SELECT - `rm`.`id` AS `id`, - `rm`.`warehoseFk` AS `warehouse_id`, - `rm`.`km` AS `km`, - `rm`.`packages` AS `bultos`, - `rm`.`vehicleCost` AS `vehiculos_coste`, - `rm`.`staffCost` AS `personal_coste`, - `rm`.`vehicle` AS `vehiculos_numero`, - `rm`.`staff` AS `personal_numero`, - `rm`.`fuel` AS `gasoil`, - `rm`.`freelancers` AS `autonomos`, - `rm`.`year` AS `año`, - `rm`.`mounth` AS `mes`, - `rm`.`expense` AS `gastos`, - `rm`.`freelancersPackages` AS `bultos_autonomos`, - `rm`.`kmCost` AS `coste_km`, - `rm`.`packageCost` AS `coste_bulto`, - `rm`.`freelancerPackageCost` AS `coste_bulto_autonomo` , - `rm`.`created` AS `odbc_date` - FROM `vn`.`routeMaster` `rm` \ No newline at end of file diff --git a/db/routines/vn2008/views/financialProductType.sql b/db/routines/vn2008/views/financialProductType.sql new file mode 100644 index 000000000..89a063856 --- /dev/null +++ b/db/routines/vn2008/views/financialProductType.sql @@ -0,0 +1,4 @@ +CREATE OR REPLACE DEFINER=`root`@`localhost` + SQL SECURITY DEFINER +VIEW `vn2008`.`financialProductType`AS + SELECT * FROM vn.financialProductType; \ No newline at end of file diff --git a/db/routines/vn2008/views/flight.sql b/db/routines/vn2008/views/flight.sql new file mode 100644 index 000000000..e671801c0 --- /dev/null +++ b/db/routines/vn2008/views/flight.sql @@ -0,0 +1,13 @@ +CREATE OR REPLACE DEFINER=`root`@`localhost` + SQL SECURITY DEFINER + VIEW `vn2008`.`flight` +AS SELECT + `f`.`id` AS `flight_id`, + `f`.`duration` AS `duration`, + `f`.`route` AS `route`, + `f`.`days` AS `days`, + `f`.`airlineFk` AS `airline_id`, + `f`.`airportOutFk` AS `airport_out`, + `f`.`airportInFk` AS `airport_in` +FROM + `vn`.`flight` `f`; \ No newline at end of file diff --git a/db/routines/vn2008/views/gastos_resumen.sql b/db/routines/vn2008/views/gastos_resumen.sql new file mode 100644 index 000000000..1b6b6d877 --- /dev/null +++ b/db/routines/vn2008/views/gastos_resumen.sql @@ -0,0 +1,11 @@ +CREATE OR REPLACE DEFINER=`root`@`localhost` + SQL SECURITY DEFINER + VIEW `vn2008`.`gastos_resumen` +AS SELECT + `es`.`expenseFk` AS `Id_Gasto`, + `es`.`year` AS `year`, + `es`.`month` AS `month`, + `es`.`amount` AS `importe`, + `es`.`companyFk` AS `empresa_id` +FROM + `vn`.`expenseSummary` `es`; \ No newline at end of file diff --git a/db/routines/vn2008/views/integra2.sql b/db/routines/vn2008/views/integra2.sql new file mode 100644 index 000000000..05840d6bb --- /dev/null +++ b/db/routines/vn2008/views/integra2.sql @@ -0,0 +1,9 @@ +CREATE OR REPLACE DEFINER=`root`@`localhost` + SQL SECURITY DEFINER + VIEW `vn2008`.`integra2` +AS SELECT + `i2`.`postCode` AS `postal_code`, + `i2`.`frequency` AS `frequency`, + `i2`.`warehouseFk` AS `warehouse_id` +FROM + `vn`.`integra2` `i2`; \ No newline at end of file diff --git a/db/routines/vn2008/views/integra2_province.sql b/db/routines/vn2008/views/integra2_province.sql new file mode 100644 index 000000000..bc099adb3 --- /dev/null +++ b/db/routines/vn2008/views/integra2_province.sql @@ -0,0 +1,8 @@ +CREATE OR REPLACE DEFINER=`root`@`localhost` + SQL SECURITY DEFINER + VIEW `vn2008`.`integra2_province` +AS SELECT + `ip`.`provinceFk` AS `province_id`, + `ip`.`franchise` AS `franquicia` +FROM + `vn`.`integra2Province` `ip`; \ No newline at end of file diff --git a/db/routines/vn2008/views/link.sql b/db/routines/vn2008/views/link.sql new file mode 100644 index 000000000..f5fb9bd2b --- /dev/null +++ b/db/routines/vn2008/views/link.sql @@ -0,0 +1,8 @@ +CREATE OR REPLACE DEFINER=`root`@`localhost` + SQL SECURITY DEFINER + VIEW `vn2008`.`link` +AS SELECT + `l`.`clientFk` AS `Id_Cliente`, + `l`.`supplierFk` AS `Id_Proveedor` +FROM + `vn`.`link` `l`; \ No newline at end of file diff --git a/db/routines/vn2008/views/warehouse_pickup.sql b/db/routines/vn2008/views/warehouse_pickup.sql new file mode 100644 index 000000000..c3a7268a1 --- /dev/null +++ b/db/routines/vn2008/views/warehouse_pickup.sql @@ -0,0 +1,9 @@ + +CREATE OR REPLACE DEFINER=`root`@`localhost` + SQL SECURITY DEFINER + VIEW `vn2008`.`warehouse_pickup` +AS SELECT + `wp`.`warehouseFk` AS `warehouse_id`, + `wp`.`agencyModeFk` AS `agency_id` +FROM + `vn`.`warehousePickup` `wp`; \ No newline at end of file diff --git a/db/versions/10836-limeCordyline/01-financialProductType.sql b/db/versions/10836-limeCordyline/01-financialProductType.sql new file mode 100644 index 000000000..c5d51e015 --- /dev/null +++ b/db/versions/10836-limeCordyline/01-financialProductType.sql @@ -0,0 +1 @@ +ALTER TABLE IF EXISTS `vn2008`.`financialProductType` RENAME `vn`.`financialProductType`; diff --git a/db/versions/10836-limeCordyline/02-flight.sql b/db/versions/10836-limeCordyline/02-flight.sql new file mode 100644 index 000000000..37849d037 --- /dev/null +++ b/db/versions/10836-limeCordyline/02-flight.sql @@ -0,0 +1,7 @@ +ALTER TABLE IF EXISTS `vn2008`.`flight` RENAME `vn`.`flight`; + +ALTER TABLE IF EXISTS `vn`.`flight` +CHANGE COLUMN IF EXISTS `flight_id` `id` varchar(10) NOT NULL, +CHANGE COLUMN IF EXISTS `airline_id` `airlineFk` smallint(2) unsigned DEFAULT NULL, +CHANGE COLUMN IF EXISTS `airport_out` `airportOutFk` varchar(3) NOT NULL, +CHANGE COLUMN IF EXISTS `airport_in` `airportInFk` varchar(3) NOT NULL; \ No newline at end of file diff --git a/db/versions/10836-limeCordyline/03-gastos_resumen.sql b/db/versions/10836-limeCordyline/03-gastos_resumen.sql new file mode 100644 index 000000000..bfec006fa --- /dev/null +++ b/db/versions/10836-limeCordyline/03-gastos_resumen.sql @@ -0,0 +1,17 @@ +ALTER TABLE IF EXISTS `vn2008`.`gastos_resumen` RENAME `vn`.`expenseSummary`; + +ALTER TABLE IF EXISTS `vn`.`expenseSummary` +CHANGE COLUMN IF EXISTS `Id_Gasto` `expenseFk` varchar(10) NOT NULL, +CHANGE COLUMN IF EXISTS `importe` `amount` decimal(10,2) DEFAULT NULL, +CHANGE COLUMN IF EXISTS `empresa_id` `companyFk` int(11) NOT NULL; + +ALTER TABLE IF EXISTS vn.expenseSummary COLLATE=utf8mb3_general_ci; + +ALTER TABLE IF EXISTS vn.expenseSummary MODIFY COLUMN expenseFk varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL; + +ALTER TABLE IF EXISTS vn.expenseSummary ADD CONSTRAINT expenseSummary_expense_FK FOREIGN KEY (expenseFk) REFERENCES vn.expense(id) ON DELETE CASCADE ON UPDATE CASCADE; + +ALTER TABLE IF EXISTS vn.expenseSummary MODIFY COLUMN companyFk int(10) unsigned NOT NULL; + +ALTER TABLE IF EXISTS vn.expenseSummary ADD CONSTRAINT expenseSummary_company_FK FOREIGN KEY (companyFk) REFERENCES vn.company(id) ON DELETE CASCADE ON UPDATE CASCADE; + diff --git a/db/versions/10836-limeCordyline/04-integra2.sql b/db/versions/10836-limeCordyline/04-integra2.sql new file mode 100644 index 000000000..663b28d78 --- /dev/null +++ b/db/versions/10836-limeCordyline/04-integra2.sql @@ -0,0 +1,10 @@ +ALTER TABLE IF EXISTS `vn2008`.`integra2` RENAME `vn`.`integra2`; + +ALTER TABLE IF EXISTS `vn`.`integra2` +CHANGE COLUMN IF EXISTS `postal_code` `postCode` varchar(10) NOT NULL, +CHANGE COLUMN IF EXISTS `frequency` `frequency` decimal(10,2) DEFAULT NULL, +CHANGE COLUMN IF EXISTS `warehouse_id` `warehouseFk` smallint(6) unsigned NOT NULL; + +ALTER TABLE IF EXISTS vn.integra2 ADD CONSTRAINT integra2_warehouse_FK +FOREIGN KEY (warehouseFk) REFERENCES vn.warehouse(id) ON DELETE CASCADE ON UPDATE CASCADE; + diff --git a/db/versions/10836-limeCordyline/05-integra2_province.sql b/db/versions/10836-limeCordyline/05-integra2_province.sql new file mode 100644 index 000000000..31f8f4156 --- /dev/null +++ b/db/versions/10836-limeCordyline/05-integra2_province.sql @@ -0,0 +1,4 @@ +ALTER TABLE IF EXISTS `vn2008`.`integra2_province` RENAME `vn`.`integra2Province`; +ALTER TABLE IF EXISTS `vn`.`integra2Province` +CHANGE COLUMN IF EXISTS `franquicia` `franchise` varchar(65) NOT NULL, +CHANGE COLUMN IF EXISTS `province_id` `provinceFk` smallint(6) unsigned NOT NULL; diff --git a/db/versions/10836-limeCordyline/06-intervalos__delete.sql b/db/versions/10836-limeCordyline/06-intervalos__delete.sql new file mode 100644 index 000000000..18d4f57ca --- /dev/null +++ b/db/versions/10836-limeCordyline/06-intervalos__delete.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS vn2008.intervalos__; \ No newline at end of file diff --git a/db/versions/10836-limeCordyline/09-link.sql b/db/versions/10836-limeCordyline/09-link.sql new file mode 100644 index 000000000..a1a671270 --- /dev/null +++ b/db/versions/10836-limeCordyline/09-link.sql @@ -0,0 +1,11 @@ +ALTER TABLE IF EXISTS `vn2008`.`link` RENAME `vn`.`link`; + +ALTER TABLE IF EXISTS `vn`.`link` +CHANGE COLUMN IF EXISTS `Id_Cliente` `clientFk` int(11) NOT NULL, +CHANGE COLUMN IF EXISTS `Id_Proveedor` `supplierFk` int(11) NOT NULL; + +ALTER TABLE IF EXISTS vn.link MODIFY COLUMN supplierFk int(10) unsigned NOT NULL; + +ALTER TABLE IF EXISTS vn.link ADD CONSTRAINT link_client_FK FOREIGN KEY (clientFk) REFERENCES vn.client(id) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE IF EXISTS vn.link ADD CONSTRAINT link_supplier_FK FOREIGN KEY (supplierFk) REFERENCES vn.supplier(id) ON DELETE CASCADE ON UPDATE CASCADE; + diff --git a/db/versions/10836-limeCordyline/10-mail_templates__delete.sql b/db/versions/10836-limeCordyline/10-mail_templates__delete.sql new file mode 100644 index 000000000..e30aae925 --- /dev/null +++ b/db/versions/10836-limeCordyline/10-mail_templates__delete.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS vn2008.mail_templates__; diff --git a/db/versions/10836-limeCordyline/12-ticket_location__delete.sql b/db/versions/10836-limeCordyline/12-ticket_location__delete.sql new file mode 100644 index 000000000..a7dbbfb95 --- /dev/null +++ b/db/versions/10836-limeCordyline/12-ticket_location__delete.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS vn2008.ticket_location__; \ No newline at end of file diff --git a/db/versions/10836-limeCordyline/13-turn__delete.sql b/db/versions/10836-limeCordyline/13-turn__delete.sql new file mode 100644 index 000000000..7aa69e57d --- /dev/null +++ b/db/versions/10836-limeCordyline/13-turn__delete.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS vn2008.turn__; \ No newline at end of file diff --git a/db/versions/10836-limeCordyline/25-warehouse_pickup.sql b/db/versions/10836-limeCordyline/25-warehouse_pickup.sql new file mode 100644 index 000000000..1a2479a43 --- /dev/null +++ b/db/versions/10836-limeCordyline/25-warehouse_pickup.sql @@ -0,0 +1,5 @@ +ALTER TABLE IF EXISTS `vn2008`.`warehouse_pickup` RENAME `vn`.`warehousePickup`; + +ALTER TABLE IF EXISTS `vn`.`warehousePickup` +CHANGE COLUMN IF EXISTS `warehouse_id` `warehouseFk` smallint(5) unsigned NOT NULL, +CHANGE COLUMN IF EXISTS `agency_id` `agencyModeFk` int(11) DEFAULT NULL; \ No newline at end of file diff --git a/db/versions/10836-limeCordyline/29-kk.sql b/db/versions/10836-limeCordyline/29-kk.sql new file mode 100644 index 000000000..c21980da9 --- /dev/null +++ b/db/versions/10836-limeCordyline/29-kk.sql @@ -0,0 +1,155 @@ +ALTER TABLE IF EXISTS vn2008.template_bionic_component RENAME vn2008.template_bionic_component__; +ALTER TABLE IF EXISTS vn2008.template_bionic_component__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.template_bionic_lot RENAME vn2008.template_bionic_lot__; +ALTER TABLE IF EXISTS vn2008.template_bionic_lot__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.template_bionic_price RENAME vn2008.template_bionic_price__; +ALTER TABLE IF EXISTS vn2008.template_bionic_price__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.tmpNEWTARIFAS RENAME vn2008.tmpNEWTARIFAS__; +ALTER TABLE IF EXISTS vn2008.tmpNEWTARIFAS__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.unaryScanFilter RENAME vn2008.unaryScanFilter__; +ALTER TABLE IF EXISTS vn2008.unaryScanFilter__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.unary_source RENAME vn2008.unary_source__; +ALTER TABLE IF EXISTS vn2008.unary_source__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.viaxpress RENAME vn2008.viaxpress__; +ALTER TABLE IF EXISTS vn2008.viaxpress__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.warehouse_filtro RENAME vn2008.warehouse_filtro__; +ALTER TABLE IF EXISTS vn2008.warehouse_filtro__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.warehouse_group RENAME vn2008.warehouse_group__; +ALTER TABLE IF EXISTS vn2008.warehouse_group__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.warehouse_joined RENAME vn2008.warehouse_joined__; +ALTER TABLE IF EXISTS vn2008.warehouse_joined__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.warehouse_lc RENAME vn2008.warehouse_lc__; +ALTER TABLE IF EXISTS vn2008.warehouse_lc__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.wh_selection RENAME vn2008.wh_selection__; +ALTER TABLE IF EXISTS vn2008.wh_selection__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.trolley RENAME vn2008.trolley__; +ALTER TABLE IF EXISTS vn2008.trolley__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.zones RENAME vn2008.zones__; +ALTER TABLE IF EXISTS vn2008.zones__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.tblIVA RENAME vn2008.tblIVA__; +ALTER TABLE IF EXISTS vn2008.tblIVA__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.filtros RENAME vn2008.filtros__; +ALTER TABLE IF EXISTS vn2008.filtros__ COMMENT='refs #6372 @deprecated 2023-11-21;'; + +ALTER TABLE IF EXISTS vn2008.form_query RENAME vn2008.form_query__; +ALTER TABLE IF EXISTS vn2008.form_query__ COMMENT='refs #6372 @deprecated 2023-11-21;'; + +ALTER TABLE IF EXISTS vn2008.guillen RENAME vn2008.guillen__; +ALTER TABLE IF EXISTS vn2008.guillen__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.guillen_carry RENAME vn2008.guillen_carry__; +ALTER TABLE IF EXISTS vn2008.guillen_carry__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.integra2_escala RENAME vn2008.integra2_escala__; +ALTER TABLE IF EXISTS vn2008.integra2_escala__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.invoice_observation RENAME vn2008.invoice_observation__; +ALTER TABLE IF EXISTS vn2008.invoice_observation__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.nichos RENAME vn2008.nichos__; +ALTER TABLE IF EXISTS vn2008.nichos__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.payroll_bonificaciones RENAME vn2008.payroll_bonificaciones__; +ALTER TABLE IF EXISTS vn2008.payroll_bonificaciones__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.payroll_daRENAMEs RENAME vn2008.payroll_daRENAMEs__; +ALTER TABLE IF EXISTS vn2008.payroll_daRENAMEs__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.payroll_embargos RENAME vn2008.payroll_embargos__; +ALTER TABLE IF EXISTS vn2008.payroll_embargos__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.payroll_tipobasess RENAME vn2008.payroll_tipobasess__; +ALTER TABLE IF EXISTS vn2008.payroll_tipobasess__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.preparation_exception RENAME vn2008.preparation_exception__; +ALTER TABLE IF EXISTS vn2008.preparation_exception__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.payrroll_apEmpresarial RENAME vn2008.payrroll_apEmpresarial__; +ALTER TABLE IF EXISTS vn2008.payrroll_apEmpresarial__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.rec_translaRENAMEr RENAME vn2008.rec_translaRENAMEr__; +ALTER TABLE IF EXISTS vn2008.rec_translaRENAMEr__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.recibida_agricola RENAME vn2008.recibida_agricola__; +ALTER TABLE IF EXISTS vn2008.recibida_agricola__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.rounding RENAME vn2008.rounding__; +ALTER TABLE IF EXISTS vn2008.rounding__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.scanTree RENAME vn2008.scanTree__; +ALTER TABLE IF EXISTS vn2008.scanTree__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.sort_merge_results_ernesRENAME RENAME vn2008.sort_merge_results_ernesRENAME__; +ALTER TABLE IF EXISTS vn2008.sort_merge_results_ernesRENAME__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.route RENAME vn2008.route__; +ALTER TABLE IF EXISTS vn2008.route__ COMMENT='refs #6372 @deprecated 2023-11-28;'; + +ALTER TABLE IF EXISTS vn2008.travel_reserve RENAME vn2008.travel_reserve__; +ALTER TABLE IF EXISTS vn2008.travel_reserve__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.wks RENAME vn2008.wks__; +ALTER TABLE IF EXISTS vn2008.wks__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.unary RENAME vn2008.unary__; +ALTER TABLE IF EXISTS vn2008.unary__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.unary_scan RENAME vn2008.unary_scan__; +ALTER TABLE IF EXISTS vn2008.unary_scan__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.unary_scan_line RENAME vn2008.unary_scan_line__; +ALTER TABLE IF EXISTS vn2008.unary_scan_line__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.unary_scan_line_buy RENAME vn2008.unary_scan_line_buy__; +ALTER TABLE IF EXISTS vn2008.unary_scan_line_buy__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.unary_scan_line_expedition RENAME vn2008.unary_scan_line_expedition__; +ALTER TABLE IF EXISTS vn2008.unary_scan_line_expedition__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.widget RENAME vn2008.widget__; +ALTER TABLE IF EXISTS vn2008.widget__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.scan RENAME vn2008.scan__; +ALTER TABLE IF EXISTS vn2008.scan__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.scan_line RENAME vn2008.scan_line__; +ALTER TABLE IF EXISTS vn2008.scan_line__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.tipsa RENAME vn2008.tipsa__; +ALTER TABLE IF EXISTS vn2008.tipsa__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.payroll_basess RENAME vn2008.payroll_basess__; +ALTER TABLE IF EXISTS vn2008.payroll_basess__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.movement_label RENAME vn2008.movement_label__; +ALTER TABLE IF EXISTS vn2008.movement_label__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.pago_sdc RENAME vn2008.pago_sdc__; +ALTER TABLE IF EXISTS vn2008.pago_sdc__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.transport RENAME vn2008.transport__; +ALTER TABLE IF EXISTS vn2008.transport__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.travel_pattern RENAME vn2008.travel_pattern__; +ALTER TABLE IF EXISTS vn2008.travel_pattern__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.jerarquia RENAME vn2008.jerarquia__; +ALTER TABLE IF EXISTS vn2008.jerarquia__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.language RENAME vn2008.language__; +ALTER TABLE IF EXISTS vn2008.language__ COMMENT='refs #6372 @deprecated 2023-12-13;'; diff --git a/db/versions/10836-limeCordyline/30-permissions.sql b/db/versions/10836-limeCordyline/30-permissions.sql new file mode 100644 index 000000000..c27ee1e88 --- /dev/null +++ b/db/versions/10836-limeCordyline/30-permissions.sql @@ -0,0 +1,36 @@ +-- flight +CREATE OR REPLACE DEFINER=`root`@`localhost` + SQL SECURITY DEFINER +VIEW `vn2008`.`flight` AS + SELECT 1; +GRANT SELECT, INSERT, UPDATE ON TABLE vn2008.flight TO `logistic`; +GRANT SELECT, INSERT, UPDATE ON TABLE vn.flight TO `logistic`; +-- integra2_province +CREATE OR REPLACE DEFINER=`root`@`localhost` + SQL SECURITY DEFINER +VIEW `vn2008`.`integra2_province` AS + SELECT 1; +GRANT SELECT ON TABLE vn2008.integra2_province TO `employee`; +GRANT SELECT ON TABLE vn.integra2Province TO `employee`; +-- link +CREATE OR REPLACE DEFINER=`root`@`localhost` + SQL SECURITY DEFINER +VIEW `vn2008`.`link` AS + SELECT 1; +GRANT SELECT ON TABLE vn2008.link TO `administrative`; +GRANT SELECT ON TABLE vn.link TO `administrative`; +GRANT SELECT ON TABLE vn2008.link TO `hr`; +GRANT SELECT ON TABLE vn.link TO `hr`; +-- warehouse_pickup +CREATE OR REPLACE DEFINER=`root`@`localhost` + SQL SECURITY DEFINER +VIEW `vn2008`.`warehouse_pickup` AS + SELECT 1; +GRANT SELECT ON TABLE vn2008.warehouse_pickup TO `logistic`; +GRANT SELECT ON TABLE vn.warehousePickup TO `logistic`; +GRANT SELECT ON TABLE vn2008.warehouse_pickup TO `claimManager`; +GRANT SELECT ON TABLE vn.warehousePickup TO `claimManager`; +GRANT SELECT ON TABLE vn2008.warehouse_pickup TO `employee`; +GRANT SELECT ON TABLE vn.warehousePickup TO `employee`; +GRANT SELECT ON TABLE vn2008.warehouse_pickup TO `deliveryAssistant`; +GRANT SELECT ON TABLE vn.warehousePickup TO `deliveryAssistant`;