-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(new-assessment): rewrite couchdb-setup and migration to new data…
…base for ghg
- Loading branch information
Showing
42 changed files
with
33,083 additions
and
629 deletions.
There are no files selected for viewing
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
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
couchdb-setup/bootstrap/ghg_projects_1696578512055758/_design/project/views/countries/map.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,3 @@ | ||
function(doc) { | ||
emit(doc.countryCode, doc.name) | ||
} |
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
.../bootstrap/ghg_projects_1696578512055758/_design/project/views/countries_with_info/map.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,14 @@ | ||
function (doc) { | ||
emit([doc.countryCode, doc.siteName], { | ||
id: doc._id, | ||
siteName: doc.siteName, | ||
siteId: doc.siteId, | ||
name: doc.name, | ||
created_by: doc.created_by, | ||
updated_at: doc.updated_at, | ||
users: doc.users, | ||
countryCode: doc.countryCode, | ||
lat: doc.latitude, | ||
lon: doc.longitude, | ||
}); | ||
} |
9 changes: 9 additions & 0 deletions
9
...otstrap/ghg_projects_1696578512055758/_design/project/views/countries_with_info/reduce.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,9 @@ | ||
function (keys, values, rereduce) { | ||
if (rereduce) { | ||
var sites = values.reduce((acc, x) => {acc = acc.concat(x); return acc;}, []) | ||
var uniqueSites = Object.values(sites.reduce((acc, el) => { acc[el.siteId] = el; return acc;}, {})) | ||
return uniqueSites | ||
} else { | ||
return values; | ||
} | ||
} |
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
...otstrap/ghg_projects_1696578512055758/_design/project/views/sites_with_assessments/map.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,15 @@ | ||
function (doc) { | ||
emit(doc.siteId, { | ||
id: doc._id, | ||
siteName: doc.siteName, | ||
description: doc.description, | ||
siteId: doc.siteId, | ||
name: doc.name, | ||
created_by: doc.created_by, | ||
updated_at: doc.updated_at, | ||
users: doc.users, | ||
countryCode: doc.countryCode, | ||
lat: doc.latitude, | ||
lon: doc.longitude, | ||
}); | ||
} |
9 changes: 9 additions & 0 deletions
9
...trap/ghg_projects_1696578512055758/_design/project/views/sites_with_assessments/reduce.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,9 @@ | ||
function (keys, values, rereduce) { | ||
if (rereduce) { | ||
var sites = values.reduce((acc, x) => {acc = acc.concat(x); return acc;}, []) | ||
var uniqueSites = Object.values(sites.reduce((acc, el) => { acc[el.description] = el; return acc;}, {})) | ||
return uniqueSites | ||
} else { | ||
return values; | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.