fixup! OnboardingFragment: Improvements to auto-updates setup

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2024-10-13 17:39:39 +05:30
parent 17d11bf16f
commit 1c57543614
3 changed files with 3 additions and 4 deletions

View File

@@ -30,8 +30,7 @@ object MigrationHelper {
database.beginTransaction()
try {
listOf("download", "update").forEach {
database.execSQL("ALTER TABLE `$it` ADD COLUMN targetSdk INTEGER NOT NULL")
database.execSQL("UPDATE `$it` SET targetSdk=1")
database.execSQL("ALTER TABLE `$it` ADD COLUMN targetSdk INTEGER NOT NULL DEFAULT 1")
}
database.setTransactionSuccessful()
} catch (exception: Exception) {

View File

@@ -28,7 +28,7 @@ data class Download(
var downloadedFiles: Int,
var fileList: List<File>,
val sharedLibs: List<SharedLib>,
val targetSdk: Int,
val targetSdk: Int = 1,
) : Parcelable {
val isFinished get() = downloadStatus in DownloadStatus.finished
val isRunning get() = downloadStatus in DownloadStatus.running

View File

@@ -30,7 +30,7 @@ data class Update(
val offerType: Int,
var fileList: List<File>,
val sharedLibs: List<SharedLib>,
val targetSdk: Int
val targetSdk: Int = 1
) : Parcelable {
companion object {