From d8454f001cd1e89c50aba0845be7aa485b3dbccc Mon Sep 17 00:00:00 2001 From: Pablo Costa Date: Fri, 26 Sep 2025 14:51:48 -0300 Subject: [PATCH] Remove incident `epoch_modified_date` field --- ...5.00.48.incidents-remove-epoch-date-modified.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 site/gatsby-site/migrations/2025.09.25T15.00.48.incidents-remove-epoch-date-modified.js diff --git a/site/gatsby-site/migrations/2025.09.25T15.00.48.incidents-remove-epoch-date-modified.js b/site/gatsby-site/migrations/2025.09.25T15.00.48.incidents-remove-epoch-date-modified.js new file mode 100644 index 0000000000..6ee0a11b46 --- /dev/null +++ b/site/gatsby-site/migrations/2025.09.25T15.00.48.incidents-remove-epoch-date-modified.js @@ -0,0 +1,14 @@ +/** @type {import('umzug').MigrationFn} */ +exports.up = async ({ context: { client } }) => { + const db = client.db('aiidprod'); + + const incidentsCollection = db.collection('incidents'); + + // Remove the old epoch_date_modified field + const removeResult = await incidentsCollection.updateMany( + { epoch_date_modified: { $exists: true } }, + { $unset: { epoch_date_modified: '' } } + ); + + console.log(`Removed epoch_date_modified field from ${removeResult.modifiedCount} incidents.`); +};