From e0ff67c0b4e5a2a24cb4731073a6a881a33837f1 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Fri, 3 May 2019 22:38:47 +0300 Subject: [PATCH] Another fix to that migration.. --- .../1556909512501-MigrateUsernamesToNewHistoryTable.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/migrations/1556909512501-MigrateUsernamesToNewHistoryTable.ts b/src/migrations/1556909512501-MigrateUsernamesToNewHistoryTable.ts index 1a2ae838..3079a37a 100644 --- a/src/migrations/1556909512501-MigrateUsernamesToNewHistoryTable.ts +++ b/src/migrations/1556909512501-MigrateUsernamesToNewHistoryTable.ts @@ -36,7 +36,7 @@ export class MigrateUsernamesToNewHistoryTable1556909512501 implements Migration toDelete.push(row.id); }); stream.on("end", async () => { - if (toInsert.length) { + if (toInsert.length || toDelete.length) { await queryRunner.query("START TRANSACTION"); await queryRunner.query( "INSERT INTO username_history (user_id, username, timestamp) VALUES " +