From 1999d97aeb3d97ee24a9b59a2f1453a26943b595 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Mon, 21 Feb 2022 14:06:15 -0800 Subject: [PATCH] Remove `verify` flag from `TransactionDetails` via new MIGRATIONS --- src/database/sqlite.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/database/sqlite.rs b/src/database/sqlite.rs index a01a7be3..b9c639bd 100644 --- a/src/database/sqlite.rs +++ b/src/database/sqlite.rs @@ -29,13 +29,17 @@ static MIGRATIONS: &[&str] = &[ "CREATE INDEX idx_txid_vout ON utxos(txid, vout);", "CREATE TABLE transactions (txid BLOB, raw_tx BLOB);", "CREATE INDEX idx_txid ON transactions(txid);", - "CREATE TABLE transaction_details (txid BLOB, timestamp INTEGER, received INTEGER, sent INTEGER, fee INTEGER, height INTEGER);", + "CREATE TABLE transaction_details (txid BLOB, timestamp INTEGER, received INTEGER, sent INTEGER, fee INTEGER, height INTEGER, verified INTEGER DEFAULT 0);", "CREATE INDEX idx_txdetails_txid ON transaction_details(txid);", "CREATE TABLE last_derivation_indices (keychain TEXT, value INTEGER);", "CREATE UNIQUE INDEX idx_indices_keychain ON last_derivation_indices(keychain);", "CREATE TABLE checksums (keychain TEXT, checksum BLOB);", "CREATE INDEX idx_checksums_keychain ON checksums(keychain);", - "CREATE TABLE sync_time (id INTEGER PRIMARY KEY, height INTEGER, timestamp INTEGER);" + "CREATE TABLE sync_time (id INTEGER PRIMARY KEY, height INTEGER, timestamp INTEGER);", + "ALTER TABLE transaction_details RENAME TO transaction_details_old;", + "CREATE TABLE transaction_details (txid BLOB, timestamp INTEGER, received INTEGER, sent INTEGER, fee INTEGER, height INTEGER);", + "INSERT INTO transaction_details SELECT txid, timestamp, received, sent, fee, height FROM transaction_details_old;", + "DROP TABLE transaction_details_old;", ]; /// Sqlite database stored on filesystem