Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob] Add migration for filedata

Neeraj Guptaee36ebc6a609
diff --git a/mobile/lib/db/ml/db.dart b/mobile/lib/db/ml/db.dart
index 89c4860506..77cc2ef532 100644
--- a/mobile/lib/db/ml/db.dart
+++ b/mobile/lib/db/ml/db.dart
@@ -46,6 +46,7 @@ class MLDataDB {
createNotPersonFeedbackTable,
fcClusterIDIndex,
createClipEmbeddingsTable,
+ createFileDataTable,
];
// only have a single app-wide reference to the database
@@ -237,6 +238,7 @@ class MLDataDB {
await db.execute(deleteClusterSummaryTable);
await db.execute(deleteNotPersonFeedbackTable);
await db.execute(deleteClipEmbeddingsTable);
+ await db.execute(deleteFileDataTable);
}
Future<Iterable<Uint8List>> getFaceEmbeddingsForCluster(
diff --git a/mobile/lib/db/ml/db_fields.dart b/mobile/lib/db/ml/db_fields.dart
index 7a3a9d7631..4910a35a66 100644
--- a/mobile/lib/db/ml/db_fields.dart
+++ b/mobile/lib/db/ml/db_fields.dart
@@ -106,3 +106,16 @@ CREATE TABLE IF NOT EXISTS $clipTable (
''';
const deleteClipEmbeddingsTable = 'DELETE FROM $clipTable';
+
+const fileDataTable = 'filedata';
+const createFileDataTable = '''
+CREATE TABLE IF NOT EXISTS $fileDataTable (
+ $fileIDColumn INTEGER NOT NULL,
+ type TEXT NOT NULL,
+ size INTEGER NOT NULL,
+ updated_at INTEGER NOT NULL,
+ PRIMARY KEY ($fileIDColumn, type)
+ );
+''';
+
+const deleteFileDataTable = 'DELETE FROM $fileDataTable';