IvoGoman / Diabetes-App

Development Repository for the Team Project HWS 2015/ FSS 2016
1 stars 0 forks source link

DBHandler #16

Closed Jenson92 closed 8 years ago

Jenson92 commented 8 years ago

Error if you use the DataBaseHandler:

droid.database.sqlite.SQLiteException: unknown column "FK_history_bloodsugar_level" in foreign key definition (code 1): , while compiling: CREATE TABLE IF NOT EXISTS Profile (id INTEGER PRIMARY KEY, age INTEGER, diabetes_type INTEGER, current_bloodsugar_level double, FOREIGN KEY (FK_history_bloodsugar_level) REFERENCES History_Bloodsugar(id_bloodsugar));

Think this is the same problem as described here: http://stackoverflow.com/questions/11545189/sqlite-foreign-key

I think to fix this you had to add "FK_history_bloodsugar_level double" in Line 91 in the DataBaseHandler. But as I am no expert I don't dare to change this ;-) Oooooor maybe I am totally wrong and I use the DataBaseHandler in a wrong way. @StefanHelmstetter @lgunko

IvoGoman commented 8 years ago

Pushed a Fix for the Exception as suggested by the stackoverflow post. Error is not occuring anymore after making a fresh start after installing the app on the phone