mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Add back the foreign key transaction dance.
This commit is contained in:
@@ -162,10 +162,13 @@ open class SignalDatabase(private val context: Application, databaseSecret: Data
|
||||
|
||||
Log.i(TAG, "Upgrading database: $oldVersion, $newVersion")
|
||||
val startTime = System.currentTimeMillis()
|
||||
db.setForeignKeyConstraintsEnabled(false)
|
||||
try {
|
||||
// Transactions and version bumps are handled in the migrate method
|
||||
SignalDatabaseMigrations.migrate(context, db, oldVersion, newVersion)
|
||||
} finally {
|
||||
db.setForeignKeyConstraintsEnabled(true)
|
||||
|
||||
// We have to re-begin the transaction for the calling code (see comment at start of method)
|
||||
db.beginTransaction()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user