From 0c8f0d5e6b0f88da7cb1a01655849a68336153a9 Mon Sep 17 00:00:00 2001 From: sal153 Date: Thu, 27 Jun 2024 16:54:33 +1000 Subject: [PATCH] commit script to add investment priorities to MUs #3250 --- .../addClimateSmartAgPrioritiesIntoMUs.js | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/main/scripts/releases/3.4/adhoc/addClimateSmartAgPrioritiesIntoMUs.js diff --git a/src/main/scripts/releases/3.4/adhoc/addClimateSmartAgPrioritiesIntoMUs.js b/src/main/scripts/releases/3.4/adhoc/addClimateSmartAgPrioritiesIntoMUs.js new file mode 100644 index 000000000..0ff1c8a22 --- /dev/null +++ b/src/main/scripts/releases/3.4/adhoc/addClimateSmartAgPrioritiesIntoMUs.js @@ -0,0 +1,52 @@ +load('../../../utils/audit.js'); +const adminUserId = 'system'; + +var priorities = [ + { + "category": "Reduce emissions and build resilience", + "priority": "Climate change adaptation" + }, + { + "category": "Reduce emissions and build resilience", + "priority": "On-farm emissions reduction practices" + }, + { + "category": "Harness carbon and biodiversity incentives", + "priority": "Carbon and biodiversity market information" + }, + { + "category": "Harness carbon and biodiversity incentives", + "priority": "Sustainability framework engagement" + }, + { + "category": "Harness carbon and biodiversity incentives", + "priority": "Market access and traceability" + }, + { + "category": "Drive agricultural growth", + "priority": "Native vegetation and biodiversity on-farm" + }, + { + "category": "Drive agricultural growth", + "priority": "Soil carbon" + }, + { + "category": "Drive agricultural growth", + "priority": "Soil erosion" + }, + { + "category": "Drive agricultural growth", + "priority": "Soil acidification" + }, + { + "category": "Drive agricultural growth", + "priority": "Sustainable agriculture practices" + } +]; + +var mus = db.managementUnit.find({}); +while(mus.hasNext()){ + var m = mus.next(); + db.managementUnit.updateOne({name:m.name},{$push:{"priorities": {$each : priorities}}}); + audit(m, m.managementUnitId, 'au.org.ala.ecodata.ManagementUnit', adminUserId, null, 'Update'); +} \ No newline at end of file