From 61058fb0a4985f6276db30861f9a7e80e9564832 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Fri, 17 Sep 2021 13:54:29 +0200 Subject: [PATCH] fixup! Refactored migration to run faster --- .../versions/4.14/02-fix-free-members-status-events.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/server/data/migrations/versions/4.14/02-fix-free-members-status-events.js b/core/server/data/migrations/versions/4.14/02-fix-free-members-status-events.js index 68c4e4e62a..ddecc128f5 100644 --- a/core/server/data/migrations/versions/4.14/02-fix-free-members-status-events.js +++ b/core/server/data/migrations/versions/4.14/02-fix-free-members-status-events.js @@ -30,7 +30,7 @@ module.exports = createTransactionalMigration( const events = eventsByMember[memberId]; events.sort((a, b) => { - return new Date(b) - new Date(a); + return new Date(b.created_at) - new Date(a.created_at); }); const mostRecentStatusEvent = events[0];