Add script to initialize copy to default value.

This commit is contained in:
Konstantinos Triantafyllou 2024-05-27 13:48:41 +03:00
parent 0fdb13ae56
commit a73db0e081
4 changed files with 8 additions and 7 deletions

View File

@ -234,8 +234,6 @@ function uniqueIndexes() {
db.stakeholder.createIndex( { "alias": 1 }, { unique: true } );
}
// use monitordb;
upperCaseEnumValues();
addHeightInIndicators();
addVisibility();

View File

@ -52,8 +52,6 @@ function addFooterHelpTextForPortalType(portalType) {
}
}
// use monitordb;
addHomePageInPortalType("funder");
addFooterDivIdForPortalType("funder");
addFooterHelpTextForPortalType("funder");

View File

@ -176,7 +176,5 @@ function addFundingStreamInDefaultMSCA() {
}
}
// use monitordb;
statsProfileOfIndicatorsAsVariable();
addFundingStreamInDefaultMSCA();

View File

@ -12,5 +12,12 @@ function deleteIndexParameters() {
})
}
// use irish-prod;
function addCopyWithDefaultValue() {
/* Set default profiles with copy: false */
db.stakeholder.updateMany({defaultId: null, copy: {$exists: false}}, {$set: {copy: false}});
/* Set not default profiles with copy: true */
db.stakeholder.updateMany({defaultId: {$ne: null}, copy: {$exists: false}}, {$set: {copy: true}});
}
deleteIndexParameters();
addCopyWithDefaultValue();