Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** @type {import('umzug').MigrationFn<any>} */
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.`);
};