Turn on foreign keys at startup

This commit is contained in:
Mike Dilger 2023-01-15 20:27:56 +13:00
parent b48ef649a3
commit 262a7d9065

View File

@ -54,6 +54,9 @@ pub fn setup_database() -> Result<(), Error> {
| rusqlite::OpenFlags::SQLITE_OPEN_NOFOLLOW, | rusqlite::OpenFlags::SQLITE_OPEN_NOFOLLOW,
)?; )?;
// Turn on foreign keys
connection.execute("PRAGMA foreign_keys = ON", ())?;
// Save the connection globally // Save the connection globally
{ {
let mut db = GLOBALS.db.blocking_lock(); let mut db = GLOBALS.db.blocking_lock();