Skip to content

Commit 5014aa6

Browse files
committed
Fix migration of snapshot history
1 parent d43d0aa commit 5014aa6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/api-service/lowcoder-server/src/main/java/org/lowcoder/runner/migrations/DatabaseChangelog.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ public void addTimeSeriesSnapshotHistory(MongockTemplate mongoTemplate, CommonCo
359359
}
360360

361361
// Delete the migrated records
362-
Query deleteQuery = new Query(Criteria.where("createdAt").gte(thresholdDate));
362+
Query deleteQuery = new Query(Criteria.where("createdAt").lte(thresholdDate));
363363
DeleteResult deleteResult = mongoTemplate.remove(deleteQuery, ApplicationHistorySnapshot.class);
364364

365365
log.info("Deleted {} records from the source collection.", deleteResult.getDeletedCount());
@@ -390,7 +390,7 @@ public void addTimeSeriesSnapshotHistory(MongockTemplate mongoTemplate, CommonCo
390390
.toCollection();
391391

392392
// Delete the migrated records
393-
Query deleteQuery = new Query(Criteria.where("createdAt").gte(thresholdDate));
393+
Query deleteQuery = new Query(Criteria.where("createdAt").lte(thresholdDate));
394394
DeleteResult deleteResult = mongoTemplate.remove(deleteQuery, ApplicationHistorySnapshot.class);
395395

396396
log.info("Deleted {} records from the source collection.", deleteResult.getDeletedCount());

0 commit comments

Comments
 (0)