chore: simplify delete namespace sql query

pull/24376/head
Luke Bond 2022-12-16 10:23:31 +00:00
parent a6036631ad
commit 1bc2003cf4
1 changed files with 1 additions and 8 deletions

View File

@ -684,15 +684,8 @@ WHERE name = $1;
// note that there is a uniqueness constraint on the name column in the DB
sqlx::query(
r#"
WITH namespace_id as (
SELECT id
FROM namespace
WHERE name = $1
LIMIT 1
)
DELETE FROM namespace
WHERE id = (SELECT id FROM namespace_id)
RETURNING id;
WHERE name = $1;
"#,
)
.bind(name)