I\'m using Ruby with SQLite3 and my attempts to use foreign keys in Sqlite3 were unfortunately not successful. According to sqlite3 --version, version 3.7.13 is
sqlite3 --version
One way of permanently turning on foreign_keys by default is to inject the following line into ~/.sqliterc:
~/.sqliterc
PRAGMA foreign_keys = ON;
Please note that it will affect all your databases...