commit 5139ae26954da47094ab378af5dbafb8754a7aa0
parent 0181f77c51dedff052769b2e1acbe38c0b288513
Author: Natasha Kerensikova <natgh@instinctive.eu>
Date: Wed, 31 Jan 2024 22:38:11 +0000
Foreign key checks are enabled on all connections
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/iens.scm b/src/iens.scm
@@ -105,6 +105,7 @@
(define db
(open-database db-name))
(write-line (conc "Using database " db-name " with SQLite " library-version))
+(exec (sql db "PRAGMA foreign_keys = ON;"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Database Creation/Migration
@@ -115,8 +116,7 @@
(write-line (conc "Initializing database with schema v" schema-version))
(for-each
(lambda (s) (exec (sql db s)))
- (list "PRAGMA foreign_keys = ON;"
- "CREATE TABLE config (key TEXT PRIMARY KEY, val);"
+ (list "CREATE TABLE config (key TEXT PRIMARY KEY, val);"
(conc "INSERT INTO config(key, val) VALUES "
"('schema-version'," schema-version ");")
(conc "CREATE TABLE tag (id INTEGER PRIMARY KEY, "