@@ -44,6 +44,7 @@ import de.mm20.launcher2.database.migrations.Migration_27_28
|
||||
import de.mm20.launcher2.database.migrations.Migration_28_29
|
||||
import de.mm20.launcher2.database.migrations.Migration_29_30
|
||||
import de.mm20.launcher2.database.migrations.Migration_30_31
|
||||
import de.mm20.launcher2.database.migrations.Migration_31_32
|
||||
import de.mm20.launcher2.database.migrations.Migration_6_7
|
||||
import de.mm20.launcher2.database.migrations.Migration_7_8
|
||||
import de.mm20.launcher2.database.migrations.Migration_8_9
|
||||
@@ -67,7 +68,7 @@ import java.util.UUID
|
||||
ShapesEntity::class,
|
||||
TransparenciesEntity::class,
|
||||
TypographyEntity::class,
|
||||
], version = 31, exportSchema = true
|
||||
], version = 32, exportSchema = true
|
||||
)
|
||||
@TypeConverters(ComponentNameConverter::class)
|
||||
abstract class AppDatabase : RoomDatabase() {
|
||||
@@ -175,6 +176,7 @@ abstract class AppDatabase : RoomDatabase() {
|
||||
Migration_28_29(),
|
||||
Migration_29_30(),
|
||||
Migration_30_31(),
|
||||
Migration_31_32(),
|
||||
).build()
|
||||
if (_instance == null) _instance = instance
|
||||
return instance
|
||||
|
||||
@@ -24,7 +24,9 @@ data class ForecastEntity(
|
||||
val provider: String,
|
||||
val providerUrl: String = "",
|
||||
@ColumnInfo(name = "rainProbability") val precipProbability: Int = -1,
|
||||
@Deprecated("Deprecated")
|
||||
val snowProbability: Int = -1,
|
||||
val uvIndex: Double = -1.0,
|
||||
val updateTime: Long
|
||||
) {
|
||||
companion object {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package de.mm20.launcher2.database.migrations
|
||||
|
||||
import androidx.room.migration.Migration
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
import de.mm20.launcher2.ktx.toBytes
|
||||
import de.mm20.launcher2.preferences.WidgetScreenTarget
|
||||
|
||||
class Migration_31_32 : Migration(31, 32) {
|
||||
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
db.execSQL(
|
||||
"""
|
||||
ALTER TABLE `forecasts` ADD COLUMN `uvIndex` REAL NOT NULL DEFAULT -1.0;
|
||||
""".trimIndent(),
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user