From 2c7a7aa336a2d5a4eab43f67ca2718135da39a58 Mon Sep 17 00:00:00 2001 From: Mattk70 Date: Tue, 30 Jan 2024 01:25:53 +0000 Subject: [PATCH] replace cname on id --- js/worker.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/worker.js b/js/worker.js index dbd4ba22..2bcabcc2 100644 --- a/js/worker.js +++ b/js/worker.js @@ -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