FIX Clean orphan records in llx_ecm_files into repair script.
This commit is contained in:
parent
adeddc70ca
commit
3ee618d736
@ -185,6 +185,7 @@ delete from llx_categorie_project where fk_categorie not in (select rowid from l
|
||||
|
||||
-- Fix: delete orphelins in ecm_files
|
||||
delete from llx_ecm_files where src_object_type = 'expensereport' and src_object_id NOT IN (select rowid from llx_expensereport);
|
||||
delete from llx_ecm_files where (src_object_type = 'contrat' OR src_object_type = 'contract') and src_object_id NOT IN (select rowid from llx_contrat);
|
||||
|
||||
-- Fix: delete orphelin deliveries. Note: deliveries are linked to shipment by llx_element_element only. No other links.
|
||||
delete from llx_livraisondet where fk_livraison not in (select fk_target from llx_element_element where targettype = 'delivery') AND fk_livraison not in (select fk_source from llx_element_element where sourcetype = 'delivery');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user