android: Fix database upgrade from older versions
authorTobias Brunner <tobias@strongswan.org>
Mon, 15 Apr 2019 12:24:23 +0000 (14:24 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 16 Apr 2019 13:08:23 +0000 (15:08 +0200)
src/frontends/android/app/src/main/java/org/strongswan/android/data/VpnProfileDataSource.java

index 48c468e..102b279 100644 (file)
@@ -230,7 +230,7 @@ public class VpnProfileDataSource
                                db.beginTransaction();
                                try
                                {
-                                       Cursor cursor = db.query(TABLE_VPNPROFILE, ALL_COLUMNS, KEY_UUID + " is NULL", null, null, null, null);
+                                       Cursor cursor = db.query(TABLE_VPNPROFILE, getColumns(16), KEY_UUID + " is NULL", null, null, null, null);
                                        for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext())
                                        {
                                                ContentValues values = new ContentValues();
@@ -248,7 +248,7 @@ public class VpnProfileDataSource
                        if (oldVersion < 17)
                        {
                                db.execSQL("ALTER TABLE " + TABLE_VPNPROFILE + " ADD " + KEY_DNS_SERVERS +
-                                               " TEXT;");
+                                                  " TEXT;");
                        }
                }