title: Room db migration fallbackToDestructiveMigration() not working
body: <p>I am using Room with a prepopulated database in the assets folder. For an app update,   I would like to alter this database by adding a new column and prepopulating this column with new data.</p>
  <p>The database was auto-migrated from version 1 to 2 (a table was added). From version 2 to 3, I would now like to apply abovementioned changes by providing a different 'database.db' file in the assets folder and allowing for destructive migration.</p>
  <pre><code>@Database(entities = [Object1::class, Object2::class], version = 3, autoMigrations = [
      AutoMigration (from = 1, to = 2)], exportSchema = true)
  abstract class AppDatabase : RoomDatabase() {
  
      abstract fun dao(): Dao
  
      companion object {
  
          private const val DB_NAME = &quot;database.db&quot;
  
          @Volatile
          private var instance: AppDatabase? = null
  
          fun getInstance(context: Context): AppDatabase {
              return instance ?: synchronized(this) {
                  instance ?: buildDatabase(context).also { instance = it }
              }
          }
  
          private fun buildDatabase(context: Context): AppDatabase {
              return Room.databaseBuilder(
                  context,
                  AppDatabase::class.java, &quot;AppDB.db&quot;)
                  .fallbackToDestructiveMigration()
                  .createFromAsset(DB_NAME)
                  .build()
          }
      }
  }
  </code></pre>
  <p>The problem is that I still get the following exception:</p>
  <pre><code>   java.lang.IllegalStateException: A migration from 1 to 3 was required but not found. Please provide the necessary Migration path via RoomDatabase.Builder.addMigration(Migration ...) or allow for destructive migrations via one of the RoomDatabase.Builder.fallbackToDestructiveMigration* methods.
  </code></pre>
  <p>I am unsure why this would still happen. I thought it was either providing a migration script or allowing for destructive migration that makes the migration work.</p>
  <p><strong>Added Comment:-</strong></p>
  <blockquote>
  <p>I have tried an implemented migration, but the same exception as above happened again. When I try starting over with versionCode 1, I am getting &quot;java.lang.IllegalStateException: Room cannot verify the data integrity. Looks like you've changed schema but forgot to update the version number. You can simply fix this by increasing the version number.&quot; I have also changed the database name and added android:allowBackup=&quot;false&quot; in the manifest.</p>
  </blockquote>
  <p>Any ideas?</p>