Fix database upgrade from version 2 to 3

The update isn't executed at all :/
This commit is contained in:
Julian Raufelder 2021-07-22 18:11:15 +02:00
parent 7af21eac15
commit 8435bd0174
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D

View File

@ -20,13 +20,15 @@ internal class Upgrade2To3 @Inject constructor(private val context: Context) : D
if (it.moveToFirst()) {
Sql.update("CLOUD_ENTITY")
.set("ACCESS_TOKEN", Sql.toString(encrypt(it.getString(it.getColumnIndex("ACCESS_TOKEN")))))
.where("TYPE", Sql.eq("DROPBOX"));
.where("TYPE", Sql.eq("DROPBOX"))
.executeOn(db)
}
}
Sql.update("CLOUD_ENTITY")
.set("ACCESS_TOKEN", Sql.toString(encrypt(onedriveToken())))
.where("TYPE", Sql.eq("ONEDRIVE"));
.where("TYPE", Sql.eq("ONEDRIVE"))
.executeOn(db)
db.setTransactionSuccessful()
} finally {