[mob] Add migration for filedata

This commit is contained in:
Neeraj Gupta
2024-10-29 11:43:39 +05:30
parent 8dce201ec6
commit ee36ebc6a6
2 changed files with 15 additions and 0 deletions

View File

@@ -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(

View File

@@ -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';