mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-04 01:53:59 +01:00
feat: update SQLite to Postgre conversion scripts
This commit is contained in:
parent
3f51117ea9
commit
c1f6845ad9
1 changed files with 9 additions and 7 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Reference in a new issue