Change Icon and IconPack entities again

- move `themed` column from Icon to IconPack
This commit is contained in:
MM20
2023-02-14 22:02:48 +01:00
parent af858bfbbe
commit ebba36c384
6 changed files with 30 additions and 30 deletions

View File

@@ -10,7 +10,6 @@ data class IconEntity(
val componentName: ComponentName?,
val drawable: String?,
val iconPack: String,
val themed: Boolean,
val name: String?,
@PrimaryKey(autoGenerate = true) val id : Long? = null
)

View File

@@ -8,5 +8,6 @@ data class IconPackEntity(
val name: String,
@PrimaryKey val packageName: String,
val version: String,
var scale: Float = 1f
var scale: Float = 1f,
val themed: Boolean = false,
)

View File

@@ -12,11 +12,11 @@ class Migration_19_20: Migration(19, 20) {
`componentName` TEXT,
`drawable` TEXT,
`iconPack` TEXT NOT NULL,
`themed` INTEGER NOT NULL,
`name` TEXT,
`id` INTEGER PRIMARY KEY AUTOINCREMENT)
""")
database.execSQL("INSERT INTO `Icons` (`type`, `componentName`, `drawable`, `iconPack`, `themed`, `name`) SELECT `type`, `componentName`, `drawable`, `iconPack`, 0, null FROM `Icons_old`")
database.execSQL("INSERT INTO `Icons` (`type`, `componentName`, `drawable`, `iconPack`, `themed`, `name`) SELECT `type`, `componentName`, `drawable`, `iconPack`, null FROM `Icons_old`")
database.execSQL("DROP TABLE `Icons_old`")
database.execSQL("ALTER TABLE `IconPacks` ADD COLUMN `themed` INTEGER NOT NULL DEFAULT 0")
}
}