我有工作「天」作爲創建的表如下外鍵約束不是在SQLite數據庫Android上
"create table days(" +
"day_id integer primary key autoincrement, " +
"conference_id integer , " +
"day_date text, " +
"day_start_time text, " +
"day_end_time text, " +
"day_summary text, " +
"day_description text)";
和我已經創建曲目表如上圖所示如下
CREATE_TABLE_TRACK = "create table track(" +
"track_id integer primary key autoincrement," +
"day_id integer,"+
"track_name text," +
"track_description text," +
" FOREIGN KEY(day_id) REFERENCES days(day_id) ON DELETE CASCADE)";
我有外鍵day_id引用到的表天day_id ...
所以我想的是,如果我刪除的日期則對應的軌道也應該刪除...但它簡化版,發生在我的情況..
我有源碼的版本3.5.9
並且還我在我的輔助類中加入1線作爲
> db.execSQL( 「PRAGMA foreign_keys = ON;」);
,但仍然無法工作..請幫助我..
但我說,我已經添加了線「PRAGMA foreign_keys = ON;」在我的sqlite幫助類 – NullPointerException