From c1c705729a6ae44bf211446bab964089c9ceca8a Mon Sep 17 00:00:00 2001 From: r-ca Date: Wed, 24 Jan 2024 18:40:11 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AF=E3=82=A8=E3=83=AA=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/one/nem/lacerta/source/database/dao/VcsLogDao.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/src/main/java/one/nem/lacerta/source/database/dao/VcsLogDao.java b/source/src/main/java/one/nem/lacerta/source/database/dao/VcsLogDao.java index 5e1eec55..b8923de9 100644 --- a/source/src/main/java/one/nem/lacerta/source/database/dao/VcsLogDao.java +++ b/source/src/main/java/one/nem/lacerta/source/database/dao/VcsLogDao.java @@ -57,6 +57,6 @@ public interface VcsLogDao { @Query("DELETE FROM vcs_log WHERE id = :id") void deleteById(String id); - @Query("DELETE FROM vcs_log WHERE document_id = :documentId LIMIT 1") + @Query("DELETE FROM vcs_log WHERE id = (SELECT id FROM vcs_log WHERE document_id = :documentId ORDER BY created_at DESC LIMIT 1)") void deleteLatestByDocumentId(String documentId); }