From 5390181cfa9869ebd1ca2b4d6d31517d85184817 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Tue, 31 Dec 2024 14:08:33 -0500 Subject: [PATCH] set synchronous and foreign_keys on startup --- nomen/db.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nomen/db.py b/nomen/db.py index b9f69f3..4b882bf 100644 --- a/nomen/db.py +++ b/nomen/db.py @@ -12,9 +12,6 @@ log.setLevel(logging.INFO) schema = """ PRAGMA user_version = 1; -PRAGMA main.synchronous = NORMAL; -PRAGMA foreign_keys = ON; - CREATE TABLE keywords ( guild_id INTEGER NOT NULL, keyword TEXT NOT NULL, @@ -80,6 +77,8 @@ async def setup_db(db_file): log.debug("Running start script") await db.executescript(""" PRAGMA optimize(0x10002); + PRAGMA main.synchronous = NORMAL; + PRAGMA foreign_keys = ON; """) log.debug("Adding contains function")