Skip to content

Commit

Permalink
More output during processing
Browse files Browse the repository at this point in the history
  • Loading branch information
acrosman committed Jan 14, 2022
1 parent 6e98df3 commit e512027
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/sf_calls.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,6 @@ const buildTable = (table) => {
column.index(field.name);
}
}

logMessage('Database', 'Info', `Details of ${table._tableName} complete`);
};

/**
Expand Down Expand Up @@ -575,17 +573,19 @@ const buildDatabase = (settings) => {

mainWindow.webContents.send('update_loader', { message: `Creating ${tables.length} tables` });

const dropCallback = (tableName, err) => {
if (err) {
logMessage('Database', 'Error', `Error dropping existing table ${err}`);
} else {
mainWindow.webContents.send('update_loader', { message: `Creating ${tables.length} tables: deleted ${tableName}` });
createDbTable(db.schema, tableName);
}
};

for (let i = 0; i < tables.length; i += 1) {
if (settings.overwrite) {
db.schema.dropTableIfExists(tables[i])
.asCallback((err) => {
if (err) {
logMessage('Database', 'Error', `Error dropping existing table ${err}`);
return 'Error';
}
createDbTable(db.schema, tables[i]);
return true;
});
.asCallback((err) => { dropCallback(tables[i], err); });
} else {
createDbTable(db.schema, tables[i]);
}
Expand Down

0 comments on commit e512027

Please sign in to comment.