Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix is_library detection in delete_crate_from_database #2202

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading