From b0197c73ed4ee3babb85982d589863404853f915 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 5 Jul 2020 18:15:40 +0200 Subject: server: Always enable foreign key handling --- db.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db.c b/db.c index 811d049..0de620d 100644 --- a/db.c +++ b/db.c @@ -48,6 +48,8 @@ void db_init(void){ SQLITE(open_v2,"db.db",&database,SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE,NULL); SQLITE(busy_timeout,database,500); + SQLITE(exec,database,"pragma foreign_keys = 1",NULL,NULL,NULL); + sqlite3_stmt *stmt; int res = sqlite3_prepare_v2(database, "select version from Meta", -1, &stmt, NULL); if (res == SQLITE_OK && sqlite3_step(stmt) == SQLITE_ROW) { -- cgit v1.2.3-70-g09d2