Repairs for common database issues

Following are common database issues that can be identified during an analysis and the actions Surround SCM performs to repair them.

Database issue Repair
Files marked as shared when they are not Clears the share marker
Shared files found in removed repositories Removes the shares
Invalid shares (share links also marked as share bases) Removes the invalid shares
Duplicate filenames in the same repository Renames the newer file by appending '~#' to the filename (e.g., ReadMe~2.txt)
Missing check out computer Replaces the empty check out computer field with '<unknown>'
Orphaned check outs (files checked out by deleted users) Removes the check outs
Orphaned changelists (pending changelists created by deleted users) Removes the changelists
Orphaned public filters (owner is deleted user) Changes the filter owner to the user with the lowest record ID in the database, which is typically the default Administrator user unless deleted
Orphaned private filters (owner is deleted user) Removes the filters
Undestroyed child repositories with destroyed parent repositories Destroys the child repositories
Undestroyed repositories in destroyed branches Removes the repositories in incompletely destroyed branches
Undestroyed merge events Removes the merge events
Inconsistent current version numbers Resets current versions to correct number
Invalid tip version numbers Removes invalid tip versions and sets the previous version number on the file
Branches with duplicate root repositories Destroys duplicate or invalid root repositories and removes templates from branches to restore them to their original structure
Mismarked file revision records Removes the flag that indicates the records should be destroyed
Vacuum needed (PostgreSQL only) Vacuums tables requiring it