recreate index in migration

This commit is contained in:
johan12345
2022-02-06 23:06:13 +01:00
parent d7a769a0c1
commit 2f0543a639

View File

@@ -367,6 +367,7 @@ abstract class AppDatabase : RoomDatabase() {
db.execSQL("INSERT INTO `FavoriteNew`($columnList) SELECT $columnList FROM `Favorite`")
db.execSQL("DROP TABLE `Favorite`")
db.execSQL("ALTER TABLE `FavoriteNew` RENAME TO `Favorite`")
db.execSQL("CREATE INDEX IF NOT EXISTS `index_Favorite_chargerId_chargerDataSource` ON `Favorite` (`chargerId`, `chargerDataSource`)")
db.setTransactionSuccessful()
} finally {