IDEMPIERE-2395 NoteDelete leaving orphan attachments / fix some orphans in GardenWorld seed

This commit is contained in:
Carlos Ruiz 2019-03-19 10:59:34 -03:00
parent c42572780b
commit 15dd1f43ab
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-2395 - clean orphan ad_note in seed
DELETE FROM ad_note WHERE ad_table_id=53043 AND record_id NOT IN (SELECT PP_MRP_ID FROM PP_MRP);
DELETE FROM ad_attachment WHERE ad_table_id=389 AND record_id NOT IN (SELECT ad_note_id FROM ad_note);
DELETE FROM ad_treenodecmt WHERE node_id>0 AND node_id NOT IN (SELECT cm_template_id FROM cm_template);
SELECT register_migration_script('201903191017_IDEMPIERE-2395.sql') FROM dual
;

View File

@ -0,0 +1,10 @@
-- IDEMPIERE-2395 - clean orphan ad_note in seed
DELETE FROM ad_note WHERE ad_table_id=53043 AND record_id NOT IN (SELECT PP_MRP_ID FROM PP_MRP);
DELETE FROM ad_attachment WHERE ad_table_id=389 AND record_id NOT IN (SELECT ad_note_id FROM ad_note);
DELETE FROM ad_treenodecmt WHERE node_id>0 AND node_id NOT IN (SELECT cm_template_id FROM cm_template);
SELECT register_migration_script('201903191017_IDEMPIERE-2395.sql') FROM dual
;