diff --git a/crates/matrix-sdk-sqlite/migrations/crypto_store/012_withheld_code_by_room.sql b/crates/matrix-sdk-sqlite/migrations/crypto_store/012_withheld_code_by_room.sql new file mode 100644 index 000000000..0d5948c27 --- /dev/null +++ b/crates/matrix-sdk-sqlite/migrations/crypto_store/012_withheld_code_by_room.sql @@ -0,0 +1,2 @@ +CREATE INDEX "direct_withheld_info_room_id_idx" + ON "direct_withheld_info" ("room_id"); diff --git a/crates/matrix-sdk-sqlite/src/crypto_store.rs b/crates/matrix-sdk-sqlite/src/crypto_store.rs index c0588f7de..9e05e7aed 100644 --- a/crates/matrix-sdk-sqlite/src/crypto_store.rs +++ b/crates/matrix-sdk-sqlite/src/crypto_store.rs @@ -291,6 +291,16 @@ async fn run_migrations(conn: &SqliteAsyncConn, version: u8) -> Result<()> { .await?; } + if version < 12 { + conn.with_transaction(|txn| { + txn.execute_batch(include_str!( + "../migrations/crypto_store/012_withheld_code_by_room.sql" + ))?; + txn.set_db_version(12) + }) + .await?; + } + Ok(()) }