From c1f6845ad90e3f96bcf1946c28d194b96f53432a Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Tue, 12 Jul 2022 08:32:09 +0300 Subject: [PATCH] feat: update SQLite to Postgre conversion scripts --- tools/conv.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/conv.py b/tools/conv.py index ba504b317..0fc548ab3 100644 --- a/tools/conv.py +++ b/tools/conv.py @@ -283,22 +283,24 @@ def migrate_ext(sqlite_db_file, schema, ignore_missing=True): masterpub, title, address_no, - balance + balance, + type, + fingerprint ) - VALUES (%s, %s, %s, %s, %s, %s); + VALUES (%s, %s, %s, %s, %s, %s, %s, %s); """ insert_to_pg(q, res.fetchall()) # ADDRESSES res = sq.execute("SELECT * FROM addresses;") q = f""" - INSERT INTO watchonly.addresses (id, address, wallet, amount) - VALUES (%s, %s, %s, %s); + INSERT INTO watchonly.addresses (id, address, wallet, amount, branch_index, address_index, has_activity, note) + VALUES (%s, %s, %s, %s, %s, %s, %s::boolean, %s); """ insert_to_pg(q, res.fetchall()) - # MEMPOOL - res = sq.execute("SELECT * FROM mempool;") + # CONFIG + res = sq.execute("SELECT * FROM config;") q = f""" - INSERT INTO watchonly.mempool ("user", endpoint) + INSERT INTO watchonly.config ("user", json_data) VALUES (%s, %s); """ insert_to_pg(q, res.fetchall())