all: only use one fallback method for dbs

Only use fallbackToDestructiveMigration for all databases.

I thought you had to selectively enable downgrading as well, but
apparently that disables other destructive migrations. This was not
obvious at all and caused countless issues. Absolutely flooring.
This commit is contained in:
Alexander Capehart
2023-06-08 10:15:04 -06:00
parent bce03a5833
commit aaba858fcf
3 changed files with 0 additions and 5 deletions
@@ -43,7 +43,6 @@ class CacheRoomModule {
Room.databaseBuilder(
context.applicationContext, CacheDatabase::class.java, "music_cache.db")
.fallbackToDestructiveMigration()
.fallbackToDestructiveMigrationOnDowngrade()
.build()
@Provides fun cachedSongsDao(database: CacheDatabase) = database.cachedSongsDao()
@@ -43,7 +43,5 @@ class UserRoomModule {
Room.databaseBuilder(
context.applicationContext, UserMusicDatabase::class.java, "user_music.db")
.fallbackToDestructiveMigration()
.fallbackToDestructiveMigrationFrom(0)
.fallbackToDestructiveMigrationOnDowngrade()
.build()
}
@@ -45,8 +45,6 @@ class PersistenceRoomModule {
PersistenceDatabase::class.java,
"playback_persistence.db")
.fallbackToDestructiveMigration()
.fallbackToDestructiveMigrationFrom(1)
.fallbackToDestructiveMigrationOnDowngrade()
.build()
@Provides fun playbackStateDao(database: PersistenceDatabase) = database.playbackStateDao()