From 8e274f4f17efc5b441213e7e5293ffa443a9b4bc Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 24 Dec 2021 10:10:28 +0100 Subject: [PATCH 1/2] refactor(travel): deprecated travelThermograph.temperature --- .../10400-christmas/00-travelThermograph.sql | 16 ++++++++++++++++ .../travel/back/models/travel-thermograph.json | 3 --- modules/travel/front/summary/index.html | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 db/changes/10400-christmas/00-travelThermograph.sql diff --git a/db/changes/10400-christmas/00-travelThermograph.sql b/db/changes/10400-christmas/00-travelThermograph.sql new file mode 100644 index 000000000..9c1fe3544 --- /dev/null +++ b/db/changes/10400-christmas/00-travelThermograph.sql @@ -0,0 +1,16 @@ +DROP TRIGGER `vn`.`travelThermograph_beforeInsert`; + +CREATE OR REPLACE +ALGORITHM = UNDEFINED VIEW `vn2008`.`travel_thermograph` AS +select + `tt`.`thermographFk` AS `thermograph_id`, + `tt`.`created` AS `odbc_date`, + `tt`.`warehouseFk` AS `warehouse_id`, + `tt`.`travelFk` AS `travel_id`, + `tt`.`temperatureFk` AS `temperature`, + `tt`.`result` AS `result`, + `tt`.`dmsFk` AS `gestdoc_id` +from + `vn`.`travelThermograph` `tt`; + +ALTER TABLE `vn`.`travelThermograph` CHANGE temperature temperature__ enum('COOL','WARM','DRY') CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL NULL; diff --git a/modules/travel/back/models/travel-thermograph.json b/modules/travel/back/models/travel-thermograph.json index 1e6dd1905..754df1c3e 100644 --- a/modules/travel/back/models/travel-thermograph.json +++ b/modules/travel/back/models/travel-thermograph.json @@ -20,9 +20,6 @@ "created": { "type": "date" }, - "temperature": { - "type": "string" - }, "temperatureFk": { "type": "string", "required": true diff --git a/modules/travel/front/summary/index.html b/modules/travel/front/summary/index.html index 90a2ea27f..98143a110 100644 --- a/modules/travel/front/summary/index.html +++ b/modules/travel/front/summary/index.html @@ -158,7 +158,7 @@ {{thermograph.thermographFk}} - {{thermograph.temperature}} + {{thermograph.temperatureFk}} {{thermograph.result}} {{thermograph.warehouse.name}} {{thermograph.created | date: 'dd/MM/yyyy'}} From 7cd33619e3ca13bed0238a5fedc8b579da708f20 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 28 Mar 2022 11:47:20 +0200 Subject: [PATCH 2/2] change db version --- .../00-travelThermograph.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename db/changes/{10400-christmas => 10440-fallas}/00-travelThermograph.sql (67%) diff --git a/db/changes/10400-christmas/00-travelThermograph.sql b/db/changes/10440-fallas/00-travelThermograph.sql similarity index 67% rename from db/changes/10400-christmas/00-travelThermograph.sql rename to db/changes/10440-fallas/00-travelThermograph.sql index 9c1fe3544..f76f070a0 100644 --- a/db/changes/10400-christmas/00-travelThermograph.sql +++ b/db/changes/10440-fallas/00-travelThermograph.sql @@ -1,5 +1,7 @@ DROP TRIGGER `vn`.`travelThermograph_beforeInsert`; +ALTER TABLE `vn`.`travelThermograph` CHANGE `temperature` `temperature__` enum('COOL','WARM','DRY') CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL NULL; + CREATE OR REPLACE ALGORITHM = UNDEFINED VIEW `vn2008`.`travel_thermograph` AS select @@ -11,6 +13,4 @@ select `tt`.`result` AS `result`, `tt`.`dmsFk` AS `gestdoc_id` from - `vn`.`travelThermograph` `tt`; - -ALTER TABLE `vn`.`travelThermograph` CHANGE temperature temperature__ enum('COOL','WARM','DRY') CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL NULL; + `vn`.`travelThermograph` `tt`; \ No newline at end of file