Merge pull request #357 from oliv3/bug_350

Gracefully handle package downgrade (fix #350)
Этот коммит содержится в:
Anton Tananaev
2018-09-06 08:17:42 +12:00
коммит произвёл GitHub
родитель 0b4c4cccc6 dcb60ab75e
Коммит 64687b26c2
+5
Просмотреть файл
@@ -90,6 +90,11 @@ public class DatabaseHelper extends SQLiteOpenHelper {
onCreate(db);
}
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS position;");
onCreate(db);
}
public void insertPosition(Position position) {
ContentValues values = new ContentValues();
values.put("deviceId", position.getDeviceId());