Revision 59020
Added by Alessia Bardi almost 4 years ago
patch-fundingpaths.sql | ||
---|---|---|
26 | 26 |
SET namespaceprefix = 'wt__________' |
27 | 27 |
WHERE id = 'openaire____::wellcometrust'; |
28 | 28 |
|
29 |
-- European Commission FP7 |
|
30 |
|
|
29 | 31 |
delete from project_fundingpath where funding ='ec__________::EC::FP7::UNKNOWN::UNKNOWN'; |
30 | 32 |
delete from fundingpaths where id = 'ec__________::EC::FP7::UNKNOWN::UNKNOWN'; |
33 |
|
|
34 |
-- FCT |
|
35 |
-- copy the good ones from the other db |
|
36 |
\copy (select * from project_fundingpath where project like 'fct\_\_\_\_\_\_\_\_\_%') TO '/tmp/fct_project_fundingpath-prod.sql' CSV; |
|
37 |
-- do the following on the bad ones |
|
38 |
delete from project_fundingpath where project like 'fct\_\_\_\_\_\_\_\_\_%'; |
|
39 |
|
|
40 |
CREATE TEMP TABLE fct ( |
|
41 |
_dnet_resource_identifier_ VARCHAR(2048), |
|
42 |
funding varchar(255), |
|
43 |
project varchar(255), |
|
44 |
startdate date, |
|
45 |
enddate date, |
|
46 |
semanticclass varchar(255), |
|
47 |
semanticscheme varchar(255), |
|
48 |
optional1 varchar(255), |
|
49 |
optional2 varchar(255) |
|
50 |
); |
|
51 |
|
|
52 |
\copy fct from '/tmp/fct_project_fundingpath-prod.sql' CSV; |
|
53 |
INSERT INTO project_fundingpath select * from fct; |
|
54 |
-- fct is a temp table and will be dropped when you log out |
|
55 |
|
|
56 |
-- SFI |
|
57 |
delete from project_fundingpath where funding = 'sfi_________::SFI::SFI US Ireland R&D Partnership - Planning Grant'; |
|
58 |
delete from project_fundingpath where funding ='sfi_________::SFI::SFI Stokes Professorship & Lectureship Programme'; |
|
59 |
delete from project_fundingpath where funding ='sfi_________::SFI::SFI US Ireland R&D Partnership'; |
|
60 |
delete from project_fundingpath where funding = 'sfi_________::SFI::China / Ireland Science & Technology Collaboration Research Fund�'; |
|
61 |
delete from fundingpaths where id = 'sfi_________::SFI::China / Ireland Science & Technology Collaboration Research Fund�'; |
|
62 |
delete from fundingpaths where id ='sfi_________::SFI::SFI US Ireland R&D Partnership'; |
|
63 |
delete from fundingpaths where id = 'sfi_________::SFI::SFI Stokes Professorship & Lectureship Programme'; |
|
64 |
delete from fundingpaths where id = 'sfi_________::SFI::SFI US Ireland R&D Partnership - Planning Grant'; |
|
65 |
select count(distinct project) from project_fundingpath where project like 'sfi%'; |
|
66 |
select count(distinct id) from projects where id like 'sfi%'; |
Also available in: Unified diff
#5695 : addressing the cleanup of projects with multiple funding paths