From 532fab53ed8b10ff9e72a2d38e2894696e5ac21e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20Pr=C3=A9?= Date: Tue, 12 Mar 2024 11:01:14 -0700 Subject: Delete oldest read posts first (#1600) --- .../java/ml/docilealligator/infinityforreddit/readpost/ReadPostDao.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/src/main/java/ml') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/readpost/ReadPostDao.java b/app/src/main/java/ml/docilealligator/infinityforreddit/readpost/ReadPostDao.java index b7752647..7193306a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/readpost/ReadPostDao.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/readpost/ReadPostDao.java @@ -29,7 +29,7 @@ public interface ReadPostDao { @Query("SELECT COUNT(id) FROM read_posts") int getReadPostsCount(); - @Query("DELETE FROM read_posts WHERE rowid IN (SELECT rowid FROM read_posts LIMIT 100) AND username = :username") + @Query("DELETE FROM read_posts WHERE rowid IN (SELECT rowid FROM read_posts ORDER BY time ASC LIMIT 100) AND username = :username") void deleteOldestReadPosts(String username); @Query("DELETE FROM read_posts") -- cgit v1.2.3