[Android] Fix media db upgrade

Geoffrey Métais git at videolan.org
Thu Mar 12 16:13:06 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar 12 15:59:16 2015 +0100| [fe5c0c24ec844e4b50b951f46563b452034f197e] | committer: Geoffrey Métais

Fix media db upgrade

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=fe5c0c24ec844e4b50b951f46563b452034f197e
---

 vlc-android/src/org/videolan/vlc/MediaDatabase.java |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaDatabase.java b/vlc-android/src/org/videolan/vlc/MediaDatabase.java
index 80684cc..5cfa8f4 100644
--- a/vlc-android/src/org/videolan/vlc/MediaDatabase.java
+++ b/vlc-android/src/org/videolan/vlc/MediaDatabase.java
@@ -162,6 +162,8 @@ public class MediaDatabase {
         public void dropMediaTableQuery(SQLiteDatabase db) {
             String query = "DROP TABLE " + MEDIA_TABLE_NAME + ";";
             db.execSQL(query);
+            query = "DROP TABLE " + MEDIA_VIRTUAL_TABLE_NAME + ";";
+            db.execSQL(query);
         }
 
         public void createMediaTableQuery(SQLiteDatabase db) {
@@ -187,7 +189,7 @@ public class MediaDatabase {
                     + ");";
             db.execSQL(query);
             db.execSQL("PRAGMA recursive_triggers='ON'"); //Needed for delete trigger
-            query = "CREATE VIRTUAL TABLE "
+            query = "CREATE VIRTUAL TABLE IF NOT EXISTS "
                     + MEDIA_VIRTUAL_TABLE_NAME + " USING FTS3 ("
                     + MEDIA_LOCATION + ", "
                     + MEDIA_TITLE + ", "



More information about the Android mailing list