summaryrefslogtreecommitdiffstats
path: root/src/com/android/photos
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2013-03-18 10:05:55 -0700
committerGeorge Mount <mount@google.com>2013-03-18 10:14:20 -0700
commitfcdcdd7627bcebe97284e200daee9e8e284aa7f4 (patch)
tree8b63bef6e2ddbcaaf1b7061b57d2654967c64144 /src/com/android/photos
parent4ea01ce27d0aecd1b63d7e99b747c9858fa93b02 (diff)
downloadandroid_packages_apps_Gallery2-fcdcdd7627bcebe97284e200daee9e8e284aa7f4.tar.gz
android_packages_apps_Gallery2-fcdcdd7627bcebe97284e200daee9e8e284aa7f4.tar.bz2
android_packages_apps_Gallery2-fcdcdd7627bcebe97284e200daee9e8e284aa7f4.zip
Fix "drop table" problem.
Bug 8404285 Should drop table if exists when upgrading, not just drop a table. Change-Id: Ic75fa0efc6ab44be073b2b78a8520e2289cd3148
Diffstat (limited to 'src/com/android/photos')
-rw-r--r--src/com/android/photos/data/PhotoDatabase.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/photos/data/PhotoDatabase.java b/src/com/android/photos/data/PhotoDatabase.java
index 3a9ad3cb1..f0aa4b6d4 100644
--- a/src/com/android/photos/data/PhotoDatabase.java
+++ b/src/com/android/photos/data/PhotoDatabase.java
@@ -176,7 +176,7 @@ public class PhotoDatabase extends SQLiteOpenHelper {
protected static void dropTable(SQLiteDatabase db, String table) {
db.beginTransaction();
try {
- db.execSQL("drop table " + table);
+ db.execSQL("drop table if exists " + table);
db.setTransactionSuccessful();
} finally {
db.endTransaction();