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.`); +};