Fixed sqlite issue (foreign key enabled/disabled state)