diff options
Diffstat (limited to 'src/com/android/photos')
-rw-r--r-- | src/com/android/photos/data/PhotoDatabase.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/photos/data/PhotoDatabase.java b/src/com/android/photos/data/PhotoDatabase.java index fd9cd0790..1f15c5bdc 100644 --- a/src/com/android/photos/data/PhotoDatabase.java +++ b/src/com/android/photos/data/PhotoDatabase.java @@ -101,6 +101,15 @@ public class PhotoDatabase extends SQLiteOpenHelper { @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { + recreate(db); + } + + @Override + public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) { + recreate(db); + } + + private void recreate(SQLiteDatabase db) { dropTable(db, Metadata.TABLE); dropTable(db, Photos.TABLE); dropTable(db, Albums.TABLE); |