Another fix to that migration..

This commit is contained in:
Dragory 2019-05-03 22:38:47 +03:00
parent ed6eee47f3
commit e0ff67c0b4

View file

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