Skip to content

Commit

Permalink
Fix migration to schema 2.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
  • Loading branch information
claucambra committed Dec 16, 2024
1 parent d8caf23 commit cea1baa
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ public class FilesDatabaseManager {
localFileMetadataOcIds.insert(lfmOcId)
}

migration.enumerateObjects(ofType: ItemMetadata.className()) { oldObject, _ in
guard let oldObject,
let imOcId = oldObject["ocId"] as? String,
migration.enumerateObjects(ofType: ItemMetadata.className()) { _, newObject in
guard let newObject,
let imOcId = newObject["ocId"] as? String,
localFileMetadataOcIds.contains(imOcId)
else { return }
oldObject[NSExpression(forKeyPath: \ItemMetadata.downloaded).keyPath] = true
oldObject[NSExpression(forKeyPath: \ItemMetadata.uploaded).keyPath] = true
newObject["downloaded"] = true
newObject["uploaded"] = true
}
}

Expand Down

0 comments on commit cea1baa

Please sign in to comment.