From 945eb63878ffaceb7b0624858edda1ae51beab70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Thu, 30 Jun 2022 14:12:47 +0200 Subject: [PATCH] :test_tube: Separate statements when clearing mappings in MySQL --- packages/cli/test/integration/shared/testDb.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/cli/test/integration/shared/testDb.ts b/packages/cli/test/integration/shared/testDb.ts index 552aca823d..86171bacce 100644 --- a/packages/cli/test/integration/shared/testDb.ts +++ b/packages/cli/test/integration/shared/testDb.ts @@ -174,9 +174,10 @@ async function truncateMappingTables( // mysqldb, mariadb - const promises = mappingTables.map((tableName) => - testDb.query(`DELETE FROM ${tableName}; ALTER TABLE ${tableName} AUTO_INCREMENT = 1;`), - ); + const promises = mappingTables.flatMap((tableName) => [ + testDb.query(`DELETE FROM ${tableName};`), + testDb.query(`ALTER TABLE ${tableName} AUTO_INCREMENT = 1;`), + ]); return Promise.all(promises); }