Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6176677e authored by Jim Miller's avatar Jim Miller
Browse files

Watch 2274882: Add a field to the db when we wipe due to an error in the upgrader.

This should give us the ability to diagnose and fix db upgrade errors as reported by partners and end users.
parent ba7ec917
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -648,6 +648,11 @@ public class DatabaseHelper extends SQLiteOpenHelper {
            db.execSQL("DROP INDEX IF EXISTS bookmarksIndex2");
            db.execSQL("DROP TABLE IF EXISTS favorites");
            onCreate(db);

            // Added for diagnosing settings.db wipes after the fact
            String wipeReason = oldVersion + "/" + upgradeVersion + "/" + currentVersion;
            db.execSQL("INSERT INTO secure(name,value) values('" +
                    "wiped_db_reason" + "','" + wipeReason + "');");
        }
    }