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 " +