mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-26 11:36:45 +00:00
Store file hash to avoid data duplication.
This commit is contained in:
committed by
Greyson Parrelli
parent
8449d75684
commit
7d02bb8487
@@ -76,8 +76,9 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
||||
private static final int RECIPIENT_SEARCH = 25;
|
||||
private static final int RECIPIENT_CLEANUP = 26;
|
||||
private static final int MMS_RECIPIENT_CLEANUP = 27;
|
||||
private static final int ATTACHMENT_HASHING = 28;
|
||||
|
||||
private static final int DATABASE_VERSION = 27;
|
||||
private static final int DATABASE_VERSION = 28;
|
||||
private static final String DATABASE_NAME = "signal.db";
|
||||
|
||||
private final Context context;
|
||||
@@ -522,6 +523,11 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
||||
Log.i(TAG, "MMS recipient cleanup updated " + count + " rows.");
|
||||
}
|
||||
|
||||
if (oldVersion < ATTACHMENT_HASHING) {
|
||||
db.execSQL("ALTER TABLE part ADD COLUMN data_hash TEXT DEFAULT NULL");
|
||||
db.execSQL("CREATE INDEX IF NOT EXISTS part_data_hash_index ON part (data_hash)");
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
|
||||
Reference in New Issue
Block a user