HomeSoftware Heritage

extid: remove unicity on (extid_type, extid) and (target_type, target)


extid: remove unicity on (extid_type, extid) and (target_type, target)

It did not make sense for multiple reasons:

  1. two extids can point to the same target (eg. extids with type git and git-sha256; or two package managers with different checksums)
  2. inserting two objects with the same target or extid in a single call actually wrote both, but would crash when reading
  3. inserting extid1 then extid2 would write both to Kafka, but only extid1 would be inserted. When replaying on a new DB, extid2 may be inserted and extid1 ignored

Points 2 and 3 are simply fixable bugs, but 1 is an issue by design,
and this commit fixes all of them at once.