catch exceptions thrown at adding a new column to exceptions table

This commit is contained in:
tibbi 2017-07-12 23:03:39 +02:00
parent 4c66bd4e13
commit 521eeb6b19
1 changed files with 4 additions and 1 deletions

View File

@ -139,7 +139,10 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
createExceptionsTable(db)
} catch (ignored: SQLiteException) {
}
db.execSQL("ALTER TABLE $EXCEPTIONS_TABLE_NAME ADD COLUMN $COL_CHILD_EVENT_ID INTEGER NOT NULL DEFAULT 0")
try {
db.execSQL("ALTER TABLE $EXCEPTIONS_TABLE_NAME ADD COLUMN $COL_CHILD_EVENT_ID INTEGER NOT NULL DEFAULT 0")
} catch (ignored: SQLiteException) {
}
}
}