mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-24 03:42:15 +00:00
Add: Categories field to Product table
This commit is contained in:
parent
2c1a542b0f
commit
d31dd0c675
@ -23,6 +23,7 @@ const val ROW_COMPATIBLE = "compatible"
|
||||
const val ROW_ICON = "icon"
|
||||
const val ROW_METADATA_ICON = "metadataIcon"
|
||||
const val ROW_RELEASES = "releases"
|
||||
const val ROW_CATEGORIES = "categories"
|
||||
const val ROW_VERSION = "version"
|
||||
const val ROW_SIGNATURE = "signature"
|
||||
const val ROW_ID = "_id"
|
||||
|
@ -128,7 +128,7 @@ interface ProductDao : BaseDao<Product> {
|
||||
product.${ROW_COMPATIBLE} != 0 AND product.${ROW_VERSION_CODE} >
|
||||
COALESCE(installed.${ROW_VERSION_CODE}, 0xffffffff) AND $signatureMatches)
|
||||
AS ${ROW_CAN_UPDATE}, product.${ROW_COMPATIBLE},
|
||||
product.${ROW_ICON}, product.${ROW_METADATA_ICON}, product.${ROW_RELEASES},"""
|
||||
product.${ROW_ICON}, product.${ROW_METADATA_ICON}, product.${ROW_RELEASES}, product.${ROW_CATEGORIES},"""
|
||||
|
||||
// Calculate the matching score with the search query
|
||||
if (searchQuery.isNotEmpty()) {
|
||||
@ -294,6 +294,7 @@ interface ProductTempDao : BaseDao<ProductTemp> {
|
||||
icon = it.icon
|
||||
metadataIcon = it.metadataIcon
|
||||
releases = it.releases
|
||||
categories = it.categories
|
||||
}
|
||||
})
|
||||
it.categories.forEach { category ->
|
||||
|
@ -21,7 +21,7 @@ import kotlinx.coroutines.launch
|
||||
CategoryTemp::class,
|
||||
Installed::class,
|
||||
Lock::class
|
||||
], version = 2
|
||||
], version = 3
|
||||
)
|
||||
@TypeConverters(Converters::class)
|
||||
abstract class DatabaseX : RoomDatabase() {
|
||||
|
@ -20,6 +20,7 @@ open class Product {
|
||||
var icon = ""
|
||||
var metadataIcon = ""
|
||||
var releases: List<Release> = emptyList()
|
||||
var categories: List<String> = emptyList()
|
||||
|
||||
// TODO Remove in next iteration
|
||||
@ColumnInfo(typeAffinity = ColumnInfo.BLOB)
|
||||
|
Loading…
x
Reference in New Issue
Block a user