From 4c1ed4a67e6325d93baf710e16ebfc30ae49d3c9 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Thu, 30 Sep 2021 17:42:36 +0530 Subject: [PATCH] Fix migration to not load full actions into memory (#8005) --- .../com/appsmith/server/migrations/DatabaseChangelog.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/DatabaseChangelog.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/DatabaseChangelog.java index 4173473711..24fc81978f 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/DatabaseChangelog.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/DatabaseChangelog.java @@ -3258,10 +3258,10 @@ public class DatabaseChangelog { deletionUpdates.set(fieldName(QNewAction.newAction.deleted), true); deletionUpdates.set(fieldName(QNewAction.newAction.deletedAt), Instant.now()); - final List actions = mongockTemplate.find( - query(where(fieldName(QNewAction.newAction.deleted)).ne(true)), - NewAction.class - ); + final Query actionQuery = query(where(fieldName(QNewAction.newAction.deleted)).ne(true)); + actionQuery.fields().include(fieldName(QNewAction.newAction.applicationId)); + + final List actions = mongockTemplate.find(actionQuery, NewAction.class); for (final NewAction action : actions) { final String applicationId = action.getApplicationId();