Skip to content

repo-updater: soft deletes for repos in DB store

Administrator requested to merge core/soft-delete into master

Created by: keegancsmith

This adds soft deletes to our DB store. The syncer has no knowledge of soft deletions, instead the store will update soft deleted rows if they have the same external ID.

When soft deleting a repository we give it a unique name. This is to prevent potential future conflicts on name. Alternatively we could remove the unique constraint on name, but this is a much larger change. Alternatively we could make the constraint partial on deleted_at being null. Either of these could be a follow up PR, or this solution can be seen as sufficient.

This commit updates the existing tests check invariants we expect on soft deletions:

  1. When undoing a soft-delete we get back the same ID we had before
  2. We don't get conflicts on name against soft deleted repos.

Fixes https://github.com/sourcegraph/sourcegraph/issues/6859

Merge request reports

Loading