diff --git a/.bin/copy-db.sh b/.bin/copy-db.sh index 69fa622da..988e9b69c 100755 --- a/.bin/copy-db.sh +++ b/.bin/copy-db.sh @@ -28,4 +28,5 @@ echo "Most recent file: $recent_file" # Copy the most recent back file to unarchive into the sandbox database oc cp "$pod_name:backup/$recent_file" "$tmp_dir/$recent_file" +echo "pltsvc" mongo-unarchive --uri="mongodb://mongodb:mongodb@localhost:27017/?authSource=admin" --db=pltsvc --local-path="$tmp_dir" # pragma: allowlist secret diff --git a/data-migrations/migrations/20240927022019-populate_missing_public_cloud_provider_selection_reason_field1.js b/data-migrations/migrations/20240927022019-populate_missing_public_cloud_provider_selection_reason_field1.js new file mode 100644 index 000000000..c24fbe386 --- /dev/null +++ b/data-migrations/migrations/20240927022019-populate_missing_public_cloud_provider_selection_reason_field1.js @@ -0,0 +1,18 @@ +export const up = async (db, client) => { + await Promise.all([ + db + .collection('PublicCloudRequestedProject') + .updateMany( + { $or: [{ providerSelectionReasonsNote: null }, { providerSelectionReasonsNote: { $exists: false } }] }, + { $set: { providerSelectionReasonsNote: '' } }, + ), + db + .collection('PublicCloudProject') + .updateMany( + { $or: [{ providerSelectionReasonsNote: null }, { providerSelectionReasonsNote: { $exists: false } }] }, + { $set: { providerSelectionReasonsNote: '' } }, + ), + ]); +}; + +export const down = async (db, client) => {};