Skip to content

Commit

Permalink
replace cname on id
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattk70 committed Jan 30, 2024
1 parent 4bb6338 commit 2c7a7aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2803,14 +2803,16 @@ async function onUpdateLocale(labels){
if (STATE.model === 'v2.4'){
await diskDB.runAsync('BEGIN');
for (let i = 0; i < labels.length; i++){
const id = i+1;
const [sname, cname] = labels[i].split('_');
await diskDB.runAsync('UPDATE species SET cname = ? WHERE sname = ?', cname, sname);
await diskDB.runAsync('UPDATE species SET cname = ? WHERE id = ?', cname, id);
}
await diskDB.runAsync('END');
await memoryDB.runAsync('BEGIN');
for (let i = 0; i < labels.length; i++){
const id = i+1;
const [sname, cname] = labels[i].split('_');
await memoryDB.runAsync('UPDATE species SET cname = ? WHERE sname = ?', cname, sname);
await memoryDB.runAsync('UPDATE species SET cname = ? WHERE id = ?', cname, id);
}
await memoryDB.runAsync('END');
// //reset index to flush results table
Expand Down

0 comments on commit 2c7a7aa

Please sign in to comment.