mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-03 00:15:11 +03:00
fixup! Refactored migration to run faster
This commit is contained in:
parent
484e0c1e05
commit
3165315f84
@ -19,6 +19,11 @@ module.exports = createTransactionalMigration(
|
||||
)
|
||||
.where('members.status', 'free');
|
||||
|
||||
if (freeMemberEvents.length === 0) {
|
||||
logging.info('No free members found - skipping migration');
|
||||
return;
|
||||
}
|
||||
|
||||
const eventsByMember = _.groupBy(freeMemberEvents, 'member_id');
|
||||
|
||||
const eventsToUpdate = Object.keys(eventsByMember).reduce((incorrectEvents, memberId) => {
|
||||
|
Loading…
Reference in New Issue
Block a user