Add back the foreign key transaction dance.
This commit is contained in:
parent
e0acbcc32d
commit
6e899391c0
1 changed files with 3 additions and 0 deletions
|
@ -162,10 +162,13 @@ open class SignalDatabase(private val context: Application, databaseSecret: Data
|
||||||
|
|
||||||
Log.i(TAG, "Upgrading database: $oldVersion, $newVersion")
|
Log.i(TAG, "Upgrading database: $oldVersion, $newVersion")
|
||||||
val startTime = System.currentTimeMillis()
|
val startTime = System.currentTimeMillis()
|
||||||
|
db.setForeignKeyConstraintsEnabled(false)
|
||||||
try {
|
try {
|
||||||
// Transactions and version bumps are handled in the migrate method
|
// Transactions and version bumps are handled in the migrate method
|
||||||
SignalDatabaseMigrations.migrate(context, db, oldVersion, newVersion)
|
SignalDatabaseMigrations.migrate(context, db, oldVersion, newVersion)
|
||||||
} finally {
|
} finally {
|
||||||
|
db.setForeignKeyConstraintsEnabled(true)
|
||||||
|
|
||||||
// We have to re-begin the transaction for the calling code (see comment at start of method)
|
// We have to re-begin the transaction for the calling code (see comment at start of method)
|
||||||
db.beginTransaction()
|
db.beginTransaction()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue