mirror of
https://github.com/NeoApplications/Neo-Store.git
synced 2025-03-14 10:17:08 +00:00
Fix: Release primary key uniqueness
This commit is contained in:
1437
schemas/com.machiav3lli.fdroid.database.DatabaseX/27.json
Normal file
1437
schemas/com.machiav3lli.fdroid.database.DatabaseX/27.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -49,6 +49,7 @@ const val ROW_LICENSES = "licenses"
|
||||
const val ROW_METADATA_ICON = "metadataIcon"
|
||||
const val ROW_MINSDK_VERSION = "minSdkVersion"
|
||||
const val ROW_PACKAGE_NAME = "packageName"
|
||||
const val ROW_PLATFORMS = "platforms"
|
||||
const val ROW_RELEASES = "releases"
|
||||
const val ROW_REPOSITORY_ID = "repositoryId"
|
||||
const val ROW_SCREENSHOTS = "screenshots"
|
||||
|
@ -79,7 +79,7 @@ import org.koin.dsl.module
|
||||
Downloaded::class,
|
||||
InstallTask::class,
|
||||
],
|
||||
version = 26,
|
||||
version = 27,
|
||||
exportSchema = true,
|
||||
autoMigrations = [
|
||||
AutoMigration(
|
||||
@ -169,6 +169,10 @@ import org.koin.dsl.module
|
||||
to = 26,
|
||||
spec = DatabaseX.Companion.AutoMigration25to26::class
|
||||
),
|
||||
AutoMigration(
|
||||
from = 26,
|
||||
to = 27,
|
||||
),
|
||||
]
|
||||
)
|
||||
@TypeConverters(Converters::class)
|
||||
|
@ -6,6 +6,7 @@ import androidx.room.Entity
|
||||
import androidx.room.Index
|
||||
import com.machiav3lli.fdroid.ROW_MINSDK_VERSION
|
||||
import com.machiav3lli.fdroid.ROW_PACKAGE_NAME
|
||||
import com.machiav3lli.fdroid.ROW_PLATFORMS
|
||||
import com.machiav3lli.fdroid.ROW_REPOSITORY_ID
|
||||
import com.machiav3lli.fdroid.ROW_SIGNATURE
|
||||
import com.machiav3lli.fdroid.ROW_TARGETSDK_VERSION
|
||||
@ -16,13 +17,15 @@ import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.encodeToString
|
||||
import kotlinx.serialization.json.Json
|
||||
|
||||
// TODO add repoID, use for queries
|
||||
// TODO consider denormalizing by adding minSdkVersion and maxSdkVersion columns to Product
|
||||
@Entity(
|
||||
tableName = TABLE_RELEASE,
|
||||
primaryKeys = [ROW_PACKAGE_NAME, ROW_REPOSITORY_ID, ROW_VERSION_CODE, ROW_SIGNATURE],
|
||||
primaryKeys = [ROW_PACKAGE_NAME, ROW_REPOSITORY_ID, ROW_VERSION_CODE, ROW_SIGNATURE, ROW_PLATFORMS],
|
||||
indices = [
|
||||
Index(value = [ROW_PACKAGE_NAME, ROW_REPOSITORY_ID, ROW_VERSION_CODE, ROW_SIGNATURE], unique = true),
|
||||
Index(
|
||||
value = [ROW_PACKAGE_NAME, ROW_REPOSITORY_ID, ROW_VERSION_CODE, ROW_SIGNATURE, ROW_PLATFORMS],
|
||||
unique = true
|
||||
),
|
||||
Index(value = [ROW_PACKAGE_NAME, ROW_MINSDK_VERSION, ROW_TARGETSDK_VERSION]),
|
||||
Index(value = [ROW_PACKAGE_NAME]),
|
||||
Index(value = [ROW_MINSDK_VERSION]),
|
||||
@ -33,7 +36,7 @@ import kotlinx.serialization.json.Json
|
||||
open class Release(
|
||||
val packageName: String,
|
||||
@ColumnInfo(defaultValue = "0")
|
||||
val repositoryId : Long = 0L,
|
||||
val repositoryId: Long = 0L,
|
||||
val selected: Boolean,
|
||||
val version: String,
|
||||
val versionCode: Long,
|
||||
|
Reference in New Issue
Block a user