-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
27 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...n/java/org/thoughtcrime/securesms/database/helpers/migration/V247_ClearUploadTimestamp.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright 2023 Signal Messenger, LLC | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
|
||
package org.thoughtcrime.securesms.database.helpers.migration | ||
|
||
import android.app.Application | ||
import net.zetetic.database.sqlcipher.SQLiteDatabase | ||
|
||
/** | ||
* There was a bad interaction with the digest backfill job, where digests could be changed, and then already-uploaded attachments could be re-used | ||
* but with a no-longer-matching digest. This migration set the upload timestamp to 1 for all uploaded attachments so that we don't re-use them. | ||
*/ | ||
@Suppress("ClassName") | ||
object V247_ClearUploadTimestamp : SignalDatabaseMigration { | ||
override fun migrate(context: Application, db: SQLiteDatabase, oldVersion: Int, newVersion: Int) { | ||
db.execSQL("UPDATE attachment SET upload_timestamp = 1 WHERE upload_timestamp > 0") | ||
} | ||
} |