From abc38f6cae443c0b81d7d4cf063a1be77b920ac6 Mon Sep 17 00:00:00 2001 From: Hanh Date: Wed, 16 Mar 2022 19:51:09 +0800 Subject: [PATCH] Db migration --- src/db/migration.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/db/migration.rs b/src/db/migration.rs index 8b07b65..c913517 100644 --- a/src/db/migration.rs +++ b/src/db/migration.rs @@ -139,7 +139,9 @@ pub fn init_db(connection: &Connection) -> anyhow::Result<()> { dirty BOOL NOT NULL)", NO_PARAMS, )?; + } + if version < 2 { connection.execute( "CREATE INDEX i_received_notes ON received_notes(account)", NO_PARAMS)?; connection.execute( @@ -152,7 +154,7 @@ pub fn init_db(connection: &Connection) -> anyhow::Result<()> { "CREATE INDEX i_witness ON sapling_witnesses(height)", NO_PARAMS)?; } - update_schema_version(&connection, 1)?; + update_schema_version(&connection, 2)?; Ok(()) }