@@ -24,7 +24,7 @@ import com.manalejandro.odb2bluetooth.data.database.entities.ObdSignal
|
|||||||
ObdSignal::class,
|
ObdSignal::class,
|
||||||
DtcCode::class
|
DtcCode::class
|
||||||
],
|
],
|
||||||
version = 2,
|
version = 3,
|
||||||
exportSchema = false
|
exportSchema = false
|
||||||
)
|
)
|
||||||
abstract class ObdDatabase : RoomDatabase() {
|
abstract class ObdDatabase : RoomDatabase() {
|
||||||
|
|||||||
@@ -16,10 +16,13 @@ import androidx.room.PrimaryKey
|
|||||||
entity = Model::class,
|
entity = Model::class,
|
||||||
parentColumns = ["id"],
|
parentColumns = ["id"],
|
||||||
childColumns = ["model_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(
|
data class Generation(
|
||||||
@PrimaryKey(autoGenerate = true)
|
@PrimaryKey(autoGenerate = true)
|
||||||
|
|||||||
@@ -16,10 +16,13 @@ import androidx.room.PrimaryKey
|
|||||||
entity = Brand::class,
|
entity = Brand::class,
|
||||||
parentColumns = ["id"],
|
parentColumns = ["id"],
|
||||||
childColumns = ["brand_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(
|
data class Model(
|
||||||
@PrimaryKey(autoGenerate = true)
|
@PrimaryKey(autoGenerate = true)
|
||||||
|
|||||||
@@ -16,10 +16,13 @@ import androidx.room.PrimaryKey
|
|||||||
entity = Model::class,
|
entity = Model::class,
|
||||||
parentColumns = ["id"],
|
parentColumns = ["id"],
|
||||||
childColumns = ["model_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(
|
data class ObdSignal(
|
||||||
@PrimaryKey(autoGenerate = true)
|
@PrimaryKey(autoGenerate = true)
|
||||||
|
|||||||
Referencia en una nueva incidencia
Block a user