Skip to content

armgit / ente

Public Imported from GitHub
0

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

Preserve sibling cursors in social sync time upserts

laurenspriem0c06afcdb2f8
diff --git a/mobile/apps/photos/lib/db/social_db.dart b/mobile/apps/photos/lib/db/social_db.dart
index ccb7522fed..485b970a0e 100644
--- a/mobile/apps/photos/lib/db/social_db.dart
+++ b/mobile/apps/photos/lib/db/social_db.dart
@@ -404,9 +404,9 @@ class SocialDB with SqlDbBase {
final db = await database;
await db.execute(
'''
- INSERT OR REPLACE INTO $_syncTimeTable (
- collection_id, comments_sync_time
- ) VALUES (?, ?)
+ INSERT INTO $_syncTimeTable (collection_id, comments_sync_time)
+ VALUES (?, ?)
+ ON CONFLICT(collection_id) DO UPDATE SET comments_sync_time = excluded.comments_sync_time
''',
[collectionID, syncTime],
);
@@ -416,9 +416,9 @@ class SocialDB with SqlDbBase {
final db = await database;
await db.execute(
'''
- INSERT OR REPLACE INTO $_syncTimeTable (
- collection_id, reactions_sync_time
- ) VALUES (?, ?)
+ INSERT INTO $_syncTimeTable (collection_id, reactions_sync_time)
+ VALUES (?, ?)
+ ON CONFLICT(collection_id) DO UPDATE SET reactions_sync_time = excluded.reactions_sync_time
''',
[collectionID, syncTime],
);