From e7a8ad50e85406ce78d057884a733ee8294d2d6f Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Thu, 4 Mar 2021 17:07:38 -0300 Subject: [PATCH] Add version number to chunks cache so we can later do in-place version upgrades and find out which chunks we need to store new versions for --- .../main/java/org/calyxos/backup/storage/db/ChunksCache.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/lib/src/main/java/org/calyxos/backup/storage/db/ChunksCache.kt b/storage/lib/src/main/java/org/calyxos/backup/storage/db/ChunksCache.kt index ebb070fa..501f0a5a 100644 --- a/storage/lib/src/main/java/org/calyxos/backup/storage/db/ChunksCache.kt +++ b/storage/lib/src/main/java/org/calyxos/backup/storage/db/ChunksCache.kt @@ -7,6 +7,7 @@ import androidx.room.Entity import androidx.room.Insert import androidx.room.PrimaryKey import androidx.room.Query +import org.calyxos.backup.storage.backup.Backup @Entity internal data class CachedChunk( @@ -16,7 +17,8 @@ internal data class CachedChunk( * Note that this is *not* about how many files across various snapshots are referencing it. */ @ColumnInfo(name = "ref_count") val refCount: Long, - val size: Long + val size: Long, + val version: Byte = Backup.VERSION, ) @Dao