我有如下创建的“天”表
"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的 sqlite
而且我还在我的助手类中添加了 1 行作为
> db.execSQL("PRAGMA foreign_keys=ON;");
但仍然无法正常工作..请帮帮我..