Fix some issues with restoring old backups.

There's a bug where if you restore a database with a different column
definition order than a new install, then column indexes in cursors
could be wrong. Closing and re-opening the database fixes this.

I also removed a reference to a possibly-closed database we were holding
onto in LiveRecipient.
This commit is contained in:
Greyson Parrelli
2021-11-19 10:41:38 -05:00
committed by Cody Henthorne
parent 44fa42fca4
commit ff038e3ade
2 changed files with 4 additions and 3 deletions

View File

@@ -237,6 +237,9 @@ open class SignalDatabase(private val context: Application, databaseSecret: Data
instance!!.rawWritableDatabase.execSQL("DROP TABLE IF EXISTS job_spec")
instance!!.rawWritableDatabase.execSQL("DROP TABLE IF EXISTS constraint_spec")
instance!!.rawWritableDatabase.execSQL("DROP TABLE IF EXISTS dependency_spec")
instance!!.rawWritableDatabase.close()
triggerDatabaseAccess()
}
}