Edi fixes
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2022-06-03 12:57:39 +02:00
parent 9bb264da38
commit b790ee88d9
1 changed files with 4 additions and 3 deletions

View File

@ -102,13 +102,14 @@ module.exports = Self => {
const toTable = file.toTable; const toTable = file.toTable;
const baseName = file.fileName; const baseName = file.fileName;
const tableName = `edi.${toTable}`;
await Self.rawSql(`DELETE FROM ??`, [tableName], options);
const tx = await Self.beginTransaction({}); const tx = await Self.beginTransaction({});
try { try {
const options = {transaction: tx}; const options = {transaction: tx};
const tableName = `edi.${toTable}`;
await Self.rawSql(`DELETE FROM ??`, [tableName], options);
for (const zipEntry of entries) { for (const zipEntry of entries) {
const entryName = zipEntry.entryName; const entryName = zipEntry.entryName;
console.log(`Reading file ${entryName}...`); console.log(`Reading file ${entryName}...`);