Remove helper version variable from DBHelper migration code
This commit is contained in:
parent
3ed178c2f5
commit
e0143bebbb
1 changed files with 1 additions and 3 deletions
|
@ -49,10 +49,8 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||
}
|
||||
|
||||
override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
|
||||
var version = oldVersion
|
||||
if (version == 1 && newVersion > version) {
|
||||
if (oldVersion == 1 && newVersion > oldVersion) {
|
||||
db.execSQL("ALTER TABLE $ALARMS_TABLE_NAME ADD COLUMN $COL_ONE_SHOT INTEGER NOT NULL DEFAULT 0")
|
||||
version++
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue