Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6 from ardevd/5-bug-dbmigration
Browse files Browse the repository at this point in the history
Increment database version number. Update database upgrade mechanism.
  • Loading branch information
ardevd authored Apr 29, 2018
2 parents c5229c7 + 8d60887 commit 14048a7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/src/main/java/no/aegisdynamics/habitat/util/DbHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class DbHelper extends SQLiteOpenHelper implements DeviceDataContract {
private static final String DB_NAME = "habitat.db";
private static final int DB_VERSION = 3;
private static final int DB_VERSION = 4;

public DbHelper(Context context) {
super(context, DB_NAME, null, DB_VERSION);
Expand Down Expand Up @@ -40,8 +40,6 @@ public void onCreate(SQLiteDatabase sqLiteDatabase) {

@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int previousVersion, int newVersion) {
sqLiteDatabase.execSQL("DROP TABLE IF EXISTS " + TABLE_AUTOMATION);
sqLiteDatabase.execSQL("DROP TABLE IF EXISTS " + TABLE_LOG);
onCreate(sqLiteDatabase);
}
}
}

0 comments on commit 14048a7

Please # to comment.