Skip to content

Commit 8beba92

Browse files
committed
Update version in the end of v2 migration
1 parent 8363d46 commit 8beba92

File tree

1 file changed

+8
-1
lines changed
  • ethexe/db/src/migrations

1 file changed

+8
-1
lines changed

ethexe/db/src/migrations/v2.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
use crate::{InitConfig, RawDatabase, database::BlockSmallData, migrations::v1};
2020
use anyhow::{Context, Result};
21-
use ethexe_common::db::BlockMeta;
21+
use ethexe_common::db::{BlockMeta, DBConfig};
2222
use gprimitives::H256;
2323
use parity_scale_codec::{Decode, Encode};
2424

@@ -59,6 +59,11 @@ pub async fn migration_from_v1(_config: &InitConfig, db: &RawDatabase) -> Result
5959
};
6060

6161
db.kv.put(&block_small_data_key, small_data.encode());
62+
63+
db.kv.set_config(DBConfig {
64+
version: VERSION,
65+
..db.kv.config()?
66+
});
6267
}
6368

6469
Ok(())
@@ -68,6 +73,7 @@ pub async fn migration_from_v1(_config: &InitConfig, db: &RawDatabase) -> Result
6873
mod tests {
6974
use super::*;
7075
use crate::migrations::test::assert_migration_types_hash;
76+
use ethexe_common::db::DBConfig;
7177
use scale_info::meta_type;
7278

7379
#[test]
@@ -77,6 +83,7 @@ mod tests {
7783
vec![
7884
meta_type::<v1::BlockSmallData>(),
7985
meta_type::<BlockSmallData>(),
86+
meta_type::<DBConfig>(),
8087
],
8188
"3177a0fb8ad47482d0ab5d4898b2fa6702730fe3e77fffcd24ab0901d6a5413d",
8289
);

0 commit comments

Comments
 (0)