From 5b0ca53b53bdecc7bcf7c4453d2a98a776237895 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 5 Feb 2025 23:20:54 +1100 Subject: [PATCH] fix: Use different char set --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index cb72551..8d7dcf1 100644 --- a/main.py +++ b/main.py @@ -97,8 +97,8 @@ def saveBlock(blockData): def setupDB(): """Creates the database tables""" with db.cursor() as cursor: - cursor.execute("CREATE TABLE IF NOT EXISTS blocks (hash VARCHAR(64), height BIGINT, depth INT, version INT, prevBlock VARCHAR(64), merkleRoot VARCHAR(64), witnessRoot VARCHAR(64), treeRoot VARCHAR(64), reservedRoot VARCHAR(64), time INT, bits INT, nonce BIGINT UNSIGNED, extraNonce VARCHAR(64), mask VARCHAR(64), txs JSON) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci") - cursor.execute("CREATE TABLE IF NOT EXISTS transactions (hash VARCHAR(64), witnessHash VARCHAR(64), fee BIGINT, rate BIGINT, mtime BIGINT, block BIGINT, `index` INT, version INT, inputs JSON, outputs JSON, locktime BIGINT, hex LONGTEXT) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci") + cursor.execute("CREATE TABLE IF NOT EXISTS blocks (hash VARCHAR(64), height BIGINT, depth INT, version INT, prevBlock VARCHAR(64), merkleRoot VARCHAR(64), witnessRoot VARCHAR(64), treeRoot VARCHAR(64), reservedRoot VARCHAR(64), time INT, bits INT, nonce BIGINT UNSIGNED, extraNonce VARCHAR(64), mask VARCHAR(64), txs JSON) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci") + cursor.execute("CREATE TABLE IF NOT EXISTS transactions (hash VARCHAR(64), witnessHash VARCHAR(64), fee BIGINT, rate BIGINT, mtime BIGINT, block BIGINT, `index` INT, version INT, inputs JSON, outputs JSON, locktime BIGINT, hex LONGTEXT) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci") # Get the newest block height in the database def getNewestBlock() -> int: