The old Entity as below:
@Entity(tableName = "d_course",
foreignKeys = @ForeignKey(entity = DUser.class, parentColumns = "id", childColumns = "studio"),
indices = @Index(value = "studio"))
The new Entity as below:
@Entity(tableName = "d_course",
foreignKeys = @ForeignKey(entity = DUser.class, parentColumns = "id", childColumns = "studio"),
indices = @Index(value = {"id", "studio"}))
How do I migrate this indices change.
Try to specify this index changes in migration, for example (Kotlin):
val MIGRATION_1_2 = object : Migration(1, 2) {
override fun migrate(database : SupportSQLiteDatabase) {
...
database.execSQL("CREATE INDEX index_d_course_id_studio ON d_course(id, studio)")
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With