Skip to content

Commit

Permalink
feat(event cache store): enable foreign keys pragma \o/
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjbvr committed Nov 28, 2024
1 parent aa0eb76 commit daa984f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/matrix-sdk-sqlite/src/event_cache_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ async fn run_migrations(conn: &SqliteAsyncConn, version: u8) -> Result<()> {
}

if version < 3 {
// Enable foreign keys for this database.
conn.execute_batch("PRAGMA foreign_keys = ON;").await?;

conn.with_transaction(|txn| {
txn.execute_batch(include_str!("../migrations/event_cache_store/003_events.sql"))?;
txn.set_db_version(3)
Expand Down

0 comments on commit daa984f

Please sign in to comment.