我有两个表: 路径和路径点,一个路径可以有许多路径点,但是一个路径点只分配给一个路径。
在 way points 表中,我有一个名为“ trackidfk”的列,它在跟踪完成后插入 track _ ID,但是我没有在这个列上设置外键约束。
When I delete a track I want to delete the assigned waypoints, is this possible?. I read about using Triggers but I don't think they are supported in Android.
创建路径点表:
public void onCreate(SQLiteDatabase db) {
db.execSQL( "CREATE TABLE " + TABLE_NAME
+ " ("
+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ LONGITUDE + " INTEGER,"
+ LATITUDE + " INTEGER,"
+ TIME + " INTEGER,"
+ TRACK_ID_FK + " INTEGER"
+ " );"
);
...
}