Skip to content

Commit

Permalink
ER-1242 📜 - Adding changeScripts for the changing communication messa…
Browse files Browse the repository at this point in the history
…ges statuses +semver: patch
  • Loading branch information
sachpatel committed Sep 24, 2019
1 parent b00bb1e commit af6cd7c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
print("Start updating communicationMessages collection documents which have a status of 'FailedDelivery' to 'NotSent'.");

let writeResult = db.communicationMessages.updateMany({
"status": "FailedDelivery"
}, {
"$set": { "status": "NotSent" }
});

if (writeResult.hasWriteConcernError()) {
printjson(writeResult.writeConcernError);
quit(14);
}

print(`Found ${writeResult.matchedCount} communicationMessages with status 'FailedDelivery' of which ${writeResult.modifiedCount} have now been updated to have status 'NotSent'.`);

print("Finished updating communicationMessages collection documents which have a status of 'FailedDelivery' to 'NotSent'.");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
print("Start updating communicationMessages collection documents which have a status of 'Unsent' to 'Pending'.");

let writeResult = db.communicationMessages.updateMany({
"status": "Unsent"
}, {
"$set": { "status": "Pending" }
});

if (writeResult.hasWriteConcernError()) {
printjson(writeResult.writeConcernError);
quit(14);
}

print(`Found ${writeResult.matchedCount} communicationMessages with status 'Unsent' of which ${writeResult.modifiedCount} have now been updated to have status 'Pending'.`);

print("Finished updating communicationMessages collection documents which have a status of 'Unsent' to 'Pending'.");
}

0 comments on commit af6cd7c

Please sign in to comment.