This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4.06 Test read and write from the weather table
- Loading branch information
Lyla
committed
Mar 4, 2015
1 parent
bf7b04b
commit dd092ef
Showing
1 changed file
with
71 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dd092ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The foreign key constraint on the
location_id
column of the weather table will not be enforced until you callsetForeignKeyConstraintsEnabled(true)
on theSQLiteDatabase
object (see here). A good place to do this is inonConfigure
ofWeatherDbHelper
.If the foreign key constraints are disabled (as in this code), you could use any invalid value for
locationRowId
and the insertion of the weather data still succeeds (which shouldn't be the case).