Issue 18929

Backbone publishedIn property always empty

18929
Reporter: mdoering
Assignee: mdoering
Type: Bug
Summary: Backbone publishedIn property always empty
Priority: Critical
Resolution: Fixed
Status: Closed
Created: 2017-02-13 20:12:03.963
Updated: 2017-02-22 00:11:36.453
Resolved: 2017-02-22 00:11:34.261
        
Description: No current backbone usage has the name_published_in_fk key set in postgres. Likely an import or nub build bug.

 ]]>
    


Author: mdoering@gbif.org
Created: 2017-02-20 16:52:20.731
Updated: 2017-02-20 16:52:20.731
        
Still true for january 2017 edition. Also true for the entire CoL, IPIN and many other checklists.
But ImportIT exists to make sure namePublishedIn gets through.
    


Author: mdoering@gbif.org
Comment: The issue lies in the implementation of NubSource and its concrete subclasses which do not provide any publishedIn data
Created: 2017-02-20 17:13:34.38
Updated: 2017-02-20 17:13:34.38


Author: mdoering@gbif.org
Created: 2017-02-22 00:11:11.702
Updated: 2017-02-22 00:11:11.702
        
Manually fixed the new backbone by copying over the name_published_in_fk value from the sources.
Code fix for future builds under way.
{noformat}
CREATE TABLE nubref (id int, refkey int, dataset uuid);
INSERT INTO nubref SELECT r.nub_fk, u.name_published_in_fk, u.dataset_key FROM nub_rel r JOIN name_usage u ON u.id=r.usage_fk WHERE name_published_in_fk is not null;
CREATE TABLE nubref2 AS SELECT DISTINCT ON (n.id) n.id, refkey FROM nubref n JOIN dataset d ON d.key=n.dataset ORDER BY n.id, d.nub_prio ASC;
CREATE INDEX ON nubref2(id);
UPDATE name_usage u SET name_published_in_fk=refkey FROM nubref2 n WHERE u.dataset_key=nubKey() AND u.deleted is null AND u.id=n.id;
{noformat}