🧪 Separate statements when clearing mappings in MySQL

This commit is contained in:
Iván Ovejero 2022-06-30 14:12:47 +02:00
parent e6347e34ca
commit 945eb63878

View file

@ -174,9 +174,10 @@ async function truncateMappingTables(
// mysqldb, mariadb // mysqldb, mariadb
const promises = mappingTables.map((tableName) => const promises = mappingTables.flatMap((tableName) => [
testDb.query(`DELETE FROM ${tableName}; ALTER TABLE ${tableName} AUTO_INCREMENT = 1;`), testDb.query(`DELETE FROM ${tableName};`),
); testDb.query(`ALTER TABLE ${tableName} AUTO_INCREMENT = 1;`),
]);
return Promise.all(promises); return Promise.all(promises);
} }