Codebook includes an Integrity Check feature which identifies and corrects historical problems with data in your Codebook database due to bugs that have been fixed, and recovers any orphaned records that may be in your database but assigned to a Category or Entry that has been deleted on another device.
After Integrity Check completes it will report any issues it found and repaired. Any repairs made to your database will propagate to your other devices when you next use the Sync feature.
These are issues in the database that could be caused by bugs in previous versions of Codebook, and are repaired by running Integrity Check:
Orphaned records are Entries, Fields, or Attachments that exist in your database but are not shown in the user interface because they are no longer assigned to a Category or Entry. This happens when you add or edit Entries or Fields on one device, and delete their parent Category or Entry on another device, and then Sync the changes together. The orphaned records are then present on both devices, but disconnected from the data model. Integrity check looks for these orphaned records and recovers them in the interface as follows:
Codebook keeps track of the order to display Fields on an Entry by maintaining an index on each Field, updating those indexes when you add, delete, and rearrange Fields. If you change the order of the Fields on the same Entry on two different devices and then Sync your changes, Codebook will do its best to display the Fields in the order you intended, but the indexes may be technically incorrect in the database until the next time you edit the Fields list (e.g. two fields with index 2). Integrity Check looks for such sort index discrepancies and repairs them.
While Codebook does not allow for rearranging Image Attachments on the Images view of an Entry, it does keep track of the indexes of them as they are added to and deleted from an Entry. If you add and remove images on the same Entry on two different devices and then Sync your changes, the indexes could potentially be technically incorrect in the database. Integrity Check also looks for and corrects these indexes.