aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {