Closed roger-mahler closed 9 months ago
The table tbl_sample_alt_refs
has duplicate records for columns alt_ref
, physical_sample_id
and alt_ref_type_id
. Current staging has more duplicates than found in a freshly created deployed release chain, so some of the problems might have been resolved in existing change request. There still exists 139 dublicated identified by this SQL:
select r.alt_ref, physical_sample_id, r.alt_ref_type_id, count(*)
from tbl_sample_alt_refs r
group by r.alt_ref, physical_sample_id, r.alt_ref_type_id
having count(*) > 1
The following unique constrainet is added:
alter table tbl_sample_alt_refs
add constraint uq_tbl_sample_alt_refs unique (physical_sample_id, alt_ref, alt_ref_type_id);
The table tbl_site_references
has a duplicate record for columns site_id
and biblio_id
.
select site_id, biblio_id, count(*)
from tbl_site_references
group by site_id, biblio_id
having count(*) > 1
The following unique constrainet is added:
alter table tbl_site_references
add constraint uq_site_references unique (site_id, biblio_id);
Project: ./general Change request: 20231129_DDL_MISSING_UNIQUE_CONSTRAINTS
Add missing unique constraints to the SEAD database.