From 326c5c97bda1acf60aeec0d67fef132d6d57dca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Thu, 25 Apr 2024 19:02:05 +0200 Subject: [PATCH 1/2] Hotfix test farmingDeliveryNote --- db/versions/11007-greenRose/00-firstScript.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 db/versions/11007-greenRose/00-firstScript.sql diff --git a/db/versions/11007-greenRose/00-firstScript.sql b/db/versions/11007-greenRose/00-firstScript.sql new file mode 100644 index 000000000..897533da1 --- /dev/null +++ b/db/versions/11007-greenRose/00-firstScript.sql @@ -0,0 +1,16 @@ +CREATE OR REPLACE TABLE `vn`.`farmingDeliveryNote` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `farmingFk` int(10) unsigned NOT NULL, + `deliveryNoteFk` int(11) NOT NULL, + `amount` decimal(10,2) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `farmingDeliveryNoteFk_FK` (`deliveryNoteFk`), + KEY `farmingDeliveryNoteFk_FK_1` (`farmingFk`), + CONSTRAINT `farmingDeliveryNoteFk_FK` FOREIGN KEY (`deliveryNoteFk`) REFERENCES `deliveryNote` (`id`), + CONSTRAINT `farmingDeliveryNoteFk_FK_1` FOREIGN KEY (`farmingFk`) REFERENCES `farming` (`id`) +); + +INSERT IGNORE INTO `vn`.`farmingDeliveryNote` (farmingFk, deliveryNoteFk, amount) + SELECT farmingFk, id, amount + FROM deliveryNote dn + WHERE farmingFk; \ No newline at end of file From f25d3c14c683c9f64466bb7091f32d868515d34d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Thu, 25 Apr 2024 19:06:06 +0200 Subject: [PATCH 2/2] Hotfix test farmingDeliveryNote --- db/versions/11007-greenRose/00-firstScript.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/versions/11007-greenRose/00-firstScript.sql b/db/versions/11007-greenRose/00-firstScript.sql index 897533da1..154a75532 100644 --- a/db/versions/11007-greenRose/00-firstScript.sql +++ b/db/versions/11007-greenRose/00-firstScript.sql @@ -12,5 +12,5 @@ CREATE OR REPLACE TABLE `vn`.`farmingDeliveryNote` ( INSERT IGNORE INTO `vn`.`farmingDeliveryNote` (farmingFk, deliveryNoteFk, amount) SELECT farmingFk, id, amount - FROM deliveryNote dn + FROM vn.deliveryNote dn WHERE farmingFk; \ No newline at end of file