@@ -24,7 +24,7 @@ import com.manalejandro.odb2bluetooth.data.database.entities.ObdSignal
|
||||
ObdSignal::class,
|
||||
DtcCode::class
|
||||
],
|
||||
version = 2,
|
||||
version = 3,
|
||||
exportSchema = false
|
||||
)
|
||||
abstract class ObdDatabase : RoomDatabase() {
|
||||
|
||||
@@ -16,10 +16,13 @@ import androidx.room.PrimaryKey
|
||||
entity = Model::class,
|
||||
parentColumns = ["id"],
|
||||
childColumns = ["model_id"],
|
||||
onDelete = ForeignKey.CASCADE
|
||||
onDelete = ForeignKey.NO_ACTION
|
||||
)
|
||||
],
|
||||
indices = [Index("model_id")]
|
||||
indices = [
|
||||
Index("model_id", name = "index_generations_model_id"),
|
||||
Index("model_id", name = "idx_generations_model")
|
||||
]
|
||||
)
|
||||
data class Generation(
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
|
||||
@@ -16,10 +16,13 @@ import androidx.room.PrimaryKey
|
||||
entity = Brand::class,
|
||||
parentColumns = ["id"],
|
||||
childColumns = ["brand_id"],
|
||||
onDelete = ForeignKey.CASCADE
|
||||
onDelete = ForeignKey.NO_ACTION
|
||||
)
|
||||
],
|
||||
indices = [Index("brand_id")]
|
||||
indices = [
|
||||
Index("brand_id", name = "index_models_brand_id"),
|
||||
Index("brand_id", name = "idx_models_brand")
|
||||
]
|
||||
)
|
||||
data class Model(
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
|
||||
@@ -16,10 +16,13 @@ import androidx.room.PrimaryKey
|
||||
entity = Model::class,
|
||||
parentColumns = ["id"],
|
||||
childColumns = ["model_id"],
|
||||
onDelete = ForeignKey.CASCADE
|
||||
onDelete = ForeignKey.NO_ACTION
|
||||
)
|
||||
],
|
||||
indices = [Index("model_id")]
|
||||
indices = [
|
||||
Index("model_id", name = "index_obd_signals_model_id"),
|
||||
Index("model_id", name = "idx_signals_model")
|
||||
]
|
||||
)
|
||||
data class ObdSignal(
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
|
||||
Referencia en una nueva incidencia
Block a user