-
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.
Merge pull request #496 from HDRUK/SUPP-643-hotfix
SUPP-643 - DAR - Fixed issue with incorrectly reporting NHS Digital datasets as 5 safe
- Loading branch information
Showing
4 changed files
with
37 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { PublisherModel } from '../src/resources/publisher/publisher.model'; | ||
|
||
/** | ||
* Make any changes you need to make to the database here | ||
*/ | ||
async function up() { | ||
// 1. Find all publishers | ||
const publishers = await PublisherModel.find({ allowAccessRequestManagement: true, name: { $not : /.*ALLIANCE > NHS DIGITAL.*/i } }).lean(); | ||
|
||
let ops = []; | ||
|
||
publishers.forEach(publisher => { | ||
const { _id } = publisher; | ||
ops.push({ | ||
updateOne: { | ||
filter: { _id }, | ||
update: { | ||
uses5Safes: true, | ||
}, | ||
upsert: false, | ||
}, | ||
}); | ||
}); | ||
|
||
await PublisherModel.bulkWrite(ops); | ||
} | ||
|
||
/** | ||
* Make any changes that UNDO the up function side effects here (if possible) | ||
*/ | ||
async function down() {} | ||
|
||
module.exports = { up, down }; |
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
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
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