I have preloaded database in Asset folder and it contain all data , when i Edit my database in Asset and increase version number and using fallbackToDestructiveMigration() app is work but it lose all data i want to know how to recreate database with room from assets using fallbackToDestructiveMigration() and then coping all tables from assets to new database i tried this solution but didn't work and i tired also Migrating but my database have a lot of tables and rows so i can't do that
i'm using Hilt and provides room like this :
@Singleton
@Provides
fun provideMyDataBase(mApplication: Application): MyDataBase {
return Room.databaseBuilder(mApplication, MyDataBase::class.java, DATABASE_NAME)
.createFromAsset(DATABASE_NAME)
.fallbackToDestructiveMigration()
.build()
}