25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-26 16:26:24 +01:00

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), process_flag(trap_exit, true),
case sqlite3:open(?SQLITE_DB, [{file, binary_to_list(DB)}]) of case sqlite3:open(?SQLITE_DB, [{file, binary_to_list(DB)}]) of
{ok, Ref} -> {ok, Ref} ->
sqlite3:sql_exec(?SQLITE_DB, "pragma foreign_keys = on"),
{ok, Ref}; {ok, Ref};
{error, {already_started, Ref}} -> {error, {already_started, Ref}} ->
{ok, Ref}; {ok, Ref};

View File

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