Enable/disable foreign key constraings for sqlite.

Issue #1447