aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-07-05 18:15:40 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-07-05 18:15:40 +0200
commitb0197c73ed4ee3babb85982d589863404853f915 (patch)
tree0a9ad8fd789793172d5b15b07d6ac7a0c04eb018
parentb2cae6770ba63fedb6059003e9aa0b113060807f (diff)
server: Always enable foreign key handling
-rw-r--r--db.c2
1 files changed, 2 insertions, 0 deletions
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) {