diff --git a/CHANGELOG.md b/CHANGELOG.md index d35d456b9..24d56a312 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - (**Manga/API**) Return partial responses for Manga And Chapters query ### Fixed -- . +- (**Database/H2**) Use temporary file for H2 migration tools download ## [v2.3.2232] - 2026-07-03 diff --git a/server/src/main/kotlin/suwayomi/tachidesk/server/database/H2Migration.kt b/server/src/main/kotlin/suwayomi/tachidesk/server/database/H2Migration.kt index 9e828ecd6..27cc62c86 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/server/database/H2Migration.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/server/database/H2Migration.kt @@ -130,9 +130,12 @@ object H2Migration { ) } - output.outputStream().use { out -> + val tmp = output.resolveSibling(output.name + ".tmp") + tmp.outputStream().use { out -> response.body.byteStream().copyTo(out) } + tmp.copyTo(output) + tmp.deleteExisting() } logger.info { "Saved: ${output.absolutePathString()}" }