From 7ab950d03c4d6a83a3021616ce4c15ccbaa8964d Mon Sep 17 00:00:00 2001 From: nymkappa Date: Tue, 29 Mar 2022 16:31:26 +0900 Subject: [PATCH] Add slug when we insert a mining pool for the first time --- backend/src/api/pools-parser.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/api/pools-parser.ts b/backend/src/api/pools-parser.ts index 9629916e3..005806c1d 100644 --- a/backend/src/api/pools-parser.ts +++ b/backend/src/api/pools-parser.ts @@ -135,10 +135,11 @@ class PoolsParser { logger.debug(`Update pools table now`); // Add new mining pools into the database - let queryAdd: string = 'INSERT INTO pools(name, link, regexes, addresses) VALUES '; + let queryAdd: string = 'INSERT INTO pools(name, link, regexes, addresses, slug) VALUES '; for (let i = 0; i < finalPoolDataAdd.length; ++i) { queryAdd += `('${finalPoolDataAdd[i].name}', '${finalPoolDataAdd[i].link}', - '${JSON.stringify(finalPoolDataAdd[i].regexes)}', '${JSON.stringify(finalPoolDataAdd[i].addresses)}'),`; + '${JSON.stringify(finalPoolDataAdd[i].regexes)}', '${JSON.stringify(finalPoolDataAdd[i].addresses)}', + ${JSON.stringify(finalPoolDataAdd[i].slug)}),`; } queryAdd = queryAdd.slice(0, -1) + ';';