From ceaa9f12be19d8225def41942390b3c1b55c7374 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 12 Sep 2020 00:36:44 +0530 Subject: [PATCH] Run account upgrade on DB only when upgrading from below v3 Signed-off-by: Harsh Shandilya --- app/src/main/java/me/saket/dank/data/DankSqliteOpenHelper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/me/saket/dank/data/DankSqliteOpenHelper.kt b/app/src/main/java/me/saket/dank/data/DankSqliteOpenHelper.kt index 6d9f5e27b..342ed3d10 100644 --- a/app/src/main/java/me/saket/dank/data/DankSqliteOpenHelper.kt +++ b/app/src/main/java/me/saket/dank/data/DankSqliteOpenHelper.kt @@ -31,7 +31,7 @@ class DankSqliteOpenHelper(context: Context) : SQLiteOpenHelper(context, DB_NAME db.execSQL(AccountManager.QUERY_CREATE_TABLE) } - if (oldVersion == 2 && newVersion == 3) { + if (oldVersion < 3 && newVersion == 3) { db.execSQL(AccountManager.QUERY_CREATE_TABLE) } }