Skip to content

Commit

Permalink
fix is_library detection in delete_crate_from_database
Browse files Browse the repository at this point in the history
  • Loading branch information
syphar committed Aug 29, 2023
1 parent 4e91742 commit 3735739
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/db/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,12 @@ fn delete_crate_from_database(conn: &mut Client, name: &str, crate_id: i32) -> R
transaction.execute("DELETE FROM owner_rels WHERE cid = $1;", &[&crate_id])?;
let has_library = transaction
.query_one(
"SELECT BOOL_OR(releases.is_library) AS has_library FROM releases",
&[],
"SELECT
BOOL_OR(releases.is_library) AS has_library
FROM releases
WHERE releases.crate_id = $1
",
&[&crate_id],
)?
.get("has_library");
transaction.execute("DELETE FROM releases WHERE crate_id = $1;", &[&crate_id])?;
Expand Down

0 comments on commit 3735739

Please sign in to comment.