This improves the query to count variants on authorised individuals, but in order to do that it changes the reference from tables hom_variants and het_variants to individuals.internal_id, it used to be external_id.
Deploying this to dev and prod requires to run this two updates:
update hom_variants set individual = individuals.internal_id from individuals where individual = individuals.external_id;
update het_variants set individual = individuals.internal_id from individuals where individual = individuals.external_id;
This improves the query to count variants on authorised individuals, but in order to do that it changes the reference from tables hom_variants and het_variants to individuals.internal_id, it used to be external_id.
Deploying this to dev and prod requires to run this two updates: