-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit script to add investment priorities to MUs #3250
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
src/main/scripts/releases/3.4/adhoc/addClimateSmartAgPrioritiesIntoMUs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); | ||
} |