phenopolis / phenopolis_genomics_browser

Python API and React frontend for the Phenopolis Genomics Browser
https://dev-live.phenopolis.org
MIT License
31 stars 2 forks source link

Patients cannot have an empty user #334

Closed alanwilter closed 3 years ago

alanwilter commented 3 years ago

Why?: Probably a latent issue in public.users_individuals. Patients must be owned or, at least, co-owned by Admin. Related to #332

Check:

select ui.internal_id
from public.users_individuals ui
where ui."user" = '';

Solution: Check if for a given internal_id there is, at least, one real user:

select ui.internal_id from public.users_individuals ui where ui."user" = ''
except
select ui.internal_id from public.users_individuals ui where ui."user" <> '';

It must return Zero rows.

Apply fix:

delete from public.users_individuals where "user" = '';
alanwilter commented 3 years ago

Fix applied for Dev_DB on 06/04/21, 4980 rows removed. Still present in Prod_DB.