File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
stackslib/src/chainstate/nakamoto Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,12 @@ pub const NAKAMOTO_STAGING_DB_SCHEMA_4: &[&str] = &[
165
165
r#"UPDATE db_version SET version = 4"# ,
166
166
] ;
167
167
168
- pub const NAKAMOTO_STAGING_DB_SCHEMA_LATEST : u32 = 4 ;
168
+ pub const NAKAMOTO_STAGING_DB_SCHEMA_5 : & [ & str ] = & [
169
+ r#"CREATE INDEX nakamoto_staging_blocks_by_consensus_hash_and_processed ON nakamoto_staging_blocks(consensus_hash, processed);"# ,
170
+ r#"UPDATE db_version SET version = 5"# ,
171
+ ] ;
172
+
173
+ pub const NAKAMOTO_STAGING_DB_SCHEMA_LATEST : u32 = 5 ;
169
174
170
175
pub struct NakamotoStagingBlocksConn ( rusqlite:: Connection ) ;
171
176
@@ -834,6 +839,15 @@ impl StacksChainState {
834
839
assert_eq ! ( version, 4 , "Nakamoto staging DB migration failure" ) ;
835
840
debug ! ( "Migrated Nakamoto staging blocks DB to schema 3" ) ;
836
841
}
842
+ 4 => {
843
+ debug ! ( "Migrate Nakamoto staging blocks DB to schema 5" ) ;
844
+ for cmd in NAKAMOTO_STAGING_DB_SCHEMA_5 . iter ( ) {
845
+ conn. execute ( cmd, NO_PARAMS ) ?;
846
+ }
847
+ let version = Self :: get_nakamoto_staging_blocks_db_version ( conn) ?;
848
+ assert_eq ! ( version, 5 , "Nakamoto staging DB migration failure" ) ;
849
+ debug ! ( "Migrated Nakamoto staging blocks DB to schema 5" ) ;
850
+ }
837
851
NAKAMOTO_STAGING_DB_SCHEMA_LATEST => {
838
852
break ;
839
853
}
You can’t perform that action at this time.
0 commit comments