Skip to content

Commit 08d589b

Browse files
committed
fix is_library detection in delete_crate_from_database
1 parent 4e91742 commit 08d589b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/db/delete.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,12 @@ fn delete_crate_from_database(conn: &mut Client, name: &str, crate_id: i32) -> R
174174
transaction.execute("DELETE FROM owner_rels WHERE cid = $1;", &[&crate_id])?;
175175
let has_library = transaction
176176
.query_one(
177-
"SELECT BOOL_OR(releases.is_library) AS has_library FROM releases",
178-
&[],
177+
"SELECT
178+
BOOL_OR(releases.is_library) AS has_library
179+
FROM releases
180+
WHERE releases.crate_id = $1
181+
",
182+
&[&crate_id],
179183
)?
180184
.get("has_library");
181185
transaction.execute("DELETE FROM releases WHERE crate_id = $1;", &[&crate_id])?;

0 commit comments

Comments
 (0)