Fix game version ordering, fix deleting versions with deps not working (#265)

This commit is contained in:
Geometrically
2021-12-09 18:12:21 -07:00
committed by GitHub
parent a54b2db81b
commit ddcb5cd4d3
2 changed files with 42 additions and 20 deletions

View File

@@ -461,6 +461,15 @@ impl Version {
.execute(&mut *transaction)
.await?;
sqlx::query!(
"
DELETE FROM dependencies WHERE dependent_id = $1
",
id as VersionId,
)
.execute(&mut *transaction)
.await?;
// delete version
sqlx::query!(
@@ -617,6 +626,7 @@ impl Version {
FROM game_versions_versions gvv
INNER JOIN game_versions gv on gvv.game_version_id = gv.id
WHERE gvv.joining_version_id = $1
ORDER BY gv.created
",
id as VersionId,
).fetch_all(executor),