Fixed
Status Update
Comments
bo...@google.com <bo...@google.com>
jl...@google.com <jl...@google.com>
jl...@google.com <jl...@google.com> #2
Hi there - could you verify that you do not have any foreign key violations in your database? I think this may be the reason why you are receiving this error, though we should make sure to provide a more clear error message if this is the case.
jl...@google.com <jl...@google.com> #3
Here's my entity:
@Entity(tableName = "palette")
class ManualPaletteEntity(
@PrimaryKey @ColumnInfo(name = "id") val id: String,
@ColumnInfo(name = "name") val name: String,
@ColumnInfo(name = "time_millis") val timeMillis: Long,
)
@Entity(
tableName = "float_hsv",
foreignKeys = [
ForeignKey(
entity = ManualPaletteEntity::class,
parentColumns = ["id"],
childColumns = ["palette_id"],
onDelete = ForeignKey.CASCADE
)
]
)
data class FloatHSVEntity(
@ColumnInfo(name = "hue") val hue: Float,
@ColumnInfo(name = "saturation") val saturation: Float,
@ColumnInfo(name = "value") val value: Float,
@ColumnInfo(name = "alpha") val alpha: Float,
@ColumnInfo(name = "palette_id") val paletteId: String,
@PrimaryKey(autoGenerate = true) @ColumnInfo(name = "id") val id: Int = 0,
)
jl...@google.com <jl...@google.com> #4
FK violation would happen based on the data in the database.
For that example, if you have anything in float_hsv
where palette_id
does not match an id
from ManuelPaletteEntity
, it would crash.
I'm also not sure sqlite is even able to detect that match after the fact, we should probably test that and figure out if we can workaround it.
jl...@google.com <jl...@google.com> #5
Alright, I'll try to figure out what's wrong
Description
Build: AI-213.7172.25.2211.8624637, 202205202352,
AI-213.7172.25.2211.8624637, JRE 11.0.13+0-b1751.21-8125866x64 JetBrains s.r.o., OS Mac OS X(aarch64) v12.4, screens 3024.0x1964.0, 5120.0x2880.0; Retina
AS: Electric Eel | 2022.1.1 Canary 3 Kotlin plugin: 213-1.6.21-release-for-android-studio-AS6777.52 Android Gradle Plugin: (plugin information not found) Gradle: 7.4.2 Gradle JDK: version 11.0.15 NDK: from local.properties: (not specified), latest from SDK: (not found) CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
Compose 1.2.0-beta01