diff --git a/apps/dnet-orgs-database-application/src/main/resources/scripts/prepare_import_ror.pl b/apps/dnet-orgs-database-application/src/main/resources/scripts/prepare_import_ror.pl index ff7165c1..196f8e68 100755 --- a/apps/dnet-orgs-database-application/src/main/resources/scripts/prepare_import_ror.pl +++ b/apps/dnet-orgs-database-application/src/main/resources/scripts/prepare_import_ror.pl @@ -34,7 +34,6 @@ binmode($OUT_ACRONYMS, ":utf8"); binmode($OUT_RELS, ":utf8"); binmode($OUT_URLS, ":utf8"); - foreach my $record (@$data) { my $id = 'tmp::' . md5_hex($record->{'id'}); diff --git a/apps/dnet-orgs-database-application/src/main/resources/sql/importDedupEvents.sql b/apps/dnet-orgs-database-application/src/main/resources/sql/importDedupEvents.sql index 48cf32f1..46ca44f2 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/sql/importDedupEvents.sql +++ b/apps/dnet-orgs-database-application/src/main/resources/sql/importDedupEvents.sql @@ -1,8 +1,8 @@ BEGIN; -DELETE FROM oa_conflicts WHERE created_by = 'dedupWf' and reltype = 'suggested'; -DELETE FROM oa_duplicates WHERE created_by = 'dedupWf' and reltype = 'suggested'; -DELETE FROM organizations WHERE created_by = 'dedupWf' and modified_by = 'dedupWf'; +DELETE FROM oa_conflicts WHERE created_by = 'dedupWf' and modified_by = 'dedupWf' and reltype = 'suggested'; +DELETE FROM oa_duplicates WHERE created_by = 'dedupWf' and modified_by = 'dedupWf' and reltype = 'suggested'; +DELETE FROM organizations WHERE created_by = 'dedupWf' and modified_by = 'dedupWf' and status = 'suggested'; -- FIX ORIGINAL DATA UPDATE organizations SET id = 'pending_org_::'||MD5(id) WHERE status = 'suggested' AND id NOT LIKE 'pending_org_::%';