From ef09c07d6e7c71cf4dc49fe3c3d76e02e0fda8f7 Mon Sep 17 00:00:00 2001 From: Daan Meijer Date: Mon, 5 Oct 2026 16:48:11 +0200 Subject: [PATCH] files.id migration in one transaction A failure after the old parent is dropped would leave files half-converted; in one transaction it rolls back completely. Tested on a fresh Postgres 17. Co-Authored-By: Claude Opus 5.5 --- database/migrations/1768620765160_files_bigint.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/1768620765160_files_bigint.ts b/database/migrations/1768620765160_files_bigint.ts index 8453f34..a9f82e9 100644 --- a/database/migrations/1768620765160_files_bigint.ts +++ b/database/migrations/1768620765160_files_bigint.ts @@ -18,7 +18,7 @@ const TRIGGERS = [ * rewrite also goes through the WAL (LOG.md 2026-10-05 (8)). */ export default class extends BaseSchema { - static disableTransactions = true + // One transaction: a failure anywhere leaves files as it was (it drops and recreates the parent). async up() { const q = (sql: string) => this.db.rawQuery(sql)