avoid updating Types db table if it was just created

This commit is contained in:
tibbi 2018-02-10 00:04:12 +01:00
parent ab8cbf7726
commit d343e8211f
1 changed files with 2 additions and 2 deletions

View File

@ -160,11 +160,11 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
db.execSQL("ALTER TABLE $MAIN_TABLE_NAME ADD COLUMN $COL_EVENT_SOURCE TEXT DEFAULT ''")
}
if (oldVersion < 16) {
if (oldVersion in 7..15) {
db.execSQL("ALTER TABLE $TYPES_TABLE_NAME ADD COLUMN $COL_TYPE_CALDAV_CALENDAR_ID INTEGER NOT NULL DEFAULT 0")
}
if (oldVersion < 17) {
if (oldVersion in 7..17) {
db.execSQL("ALTER TABLE $TYPES_TABLE_NAME ADD COLUMN $COL_TYPE_CALDAV_DISPLAY_NAME TEXT DEFAULT ''")
db.execSQL("ALTER TABLE $TYPES_TABLE_NAME ADD COLUMN $COL_TYPE_CALDAV_EMAIL TEXT DEFAULT ''")
}