From a249eb05729702c20f488b1ed45fdfb343231faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Tue, 26 Oct 2021 13:22:31 +0200 Subject: [PATCH] Fix broken query remove_all_by_username --- db/builder_db.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/db/builder_db.ml b/db/builder_db.ml index fd66e83..64817b2 100644 --- a/db/builder_db.ml +++ b/db/builder_db.ml @@ -666,7 +666,14 @@ module Access_list = struct let remove_all_by_username = Caqti_request.exec Caqti_type.string - "DELETE FROM access_list, user WHERE access_list.user = user.id AND user.username = ?" + {| DELETE FROM access_list + WHERE access_list.id IN ( + SELECT access_list.id + FROM access_list + INNER JOIN user ON access_list.user = user.id + WHERE user.username = ? + ) + |} end