It must be enabled before creating the database in the onCreate () method; before creating tables? Or does it turn on before accessing the database from the client?
All PRAGMA needs to be declared here. SQLiteOpenHelper.onOpen(SQLiteDatabase) It looks like this:
SQLiteOpenHelper.onOpen(SQLiteDatabase)
class MyDBHelper extends SQLiteOpenHelper { @Override public void onOpen(SQLiteDatabase myDatabase){ myDataBase.execSQL("PRAGMA foreign_keys=ON"); } }
Source: https://ru.stackoverflow.com/questions/535963/More articles:BEM how to collect merged bandsAdding additional data to the table when selecting a particular itemXCODE Includes FBSDKLoginKit.FBSDKLoginButtonStop the script and restore its workDisplay elements and attributes from xmlWhat method is called when using 'Intent.FLAG_ACTIVITY_CLEAR_TASK'?Using NSUndoManager in SwiftAdding Commands for UserControl wpfHow to place a lot of Yandex maps on one page without id?Member functions in numpy records?All Articles