Enable FOREIGN KEYS by default

This commit is contained in:
Evgeniy Khramtsov 2015-04-08 14:39:47 +03:00
parent 2a3a2d9804
commit bdedcf8d8a
2 changed files with 2 additions and 0 deletions

View File

@ -501,6 +501,7 @@ sqlite_connect(DB) ->
process_flag(trap_exit, true),
case sqlite3:open(?SQLITE_DB, [{file, binary_to_list(DB)}]) of
{ok, Ref} ->
sqlite3:sql_exec(?SQLITE_DB, "pragma foreign_keys = on"),
{ok, Ref};
{error, {already_started, Ref}} ->
{ok, Ref};

View File

@ -143,6 +143,7 @@ check_sqlite_db(DB) ->
end,
case Ret of
ok ->
sqlite3:sql_exec(?SQLITE_DB, "pragma foreign_keys = on"),
case sqlite3:list_tables(?SQLITE_DB) of
[] ->
create_sqlite_tables(),