From 5a5100395a4d3580e817f09d94293c00edc5b24d Mon Sep 17 00:00:00 2001 From: Kevin Gorham Date: Fri, 30 Apr 2021 23:06:28 -0400 Subject: [PATCH] Drop accounts table instead. We need to recreate the table each time it is cleared to handle any migrations. This is mostly a stop-gap measure until the migrations and table creations are handled by the same code. --- zcash_client_sqlite/src/wallet/init.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/zcash_client_sqlite/src/wallet/init.rs b/zcash_client_sqlite/src/wallet/init.rs index f724a9c9f..0e7c81df9 100644 --- a/zcash_client_sqlite/src/wallet/init.rs +++ b/zcash_client_sqlite/src/wallet/init.rs @@ -209,12 +209,10 @@ pub fn init_accounts_table( Ok(()) } -pub fn clear_accounts_table( +pub fn drop_accounts_table( wdb: &WalletDb

, ) -> Result<(), SqliteClientError> { - wdb.conn.execute("PRAGMA foreign_keys = OFF;", NO_PARAMS)?; - wdb.conn.execute( "DELETE FROM accounts;", NO_PARAMS, )?; - wdb.conn.execute("PRAGMA foreign_keys = ON;", NO_PARAMS)?; + wdb.conn.execute( "DROP TABLE accounts;", NO_PARAMS, )?; Ok(()) }