Opened 16 months ago

Last modified 6 weeks ago

#3109 new enhancement

Add 'plant_name' field to the 'get_accession_pedigree' dataview

Reported by: Pete Cyr Owned by: Kurt Endress
Priority: medium Milestone:
Component: Dataviews (CT) Version: N/A
Severity: 1 -- Low Effort Keywords:
Cc: Database Engine: N/A
Operating System: N/A

Description

Add the 'plant_name' field to the 'get_accession_pedigree' dataview and put it next to the 'accession_id' field.

Change History (3)

comment:1 by Pete Cyr, 16 months ago

The update for 'get_accession_pedigree' has been deployed to (and tested) on npgsDev server. The testers are satisfied with the update and are requesting it to be promoted to npgsWeb server.

comment:2 by Benjamin Haag, 6 weeks ago

Severity: → 1 -- Low Effort

These changes are not on the dev server for some reason. Below is the current SQL behind the get_accession_pedigree dataview, which is listed as having been last modified in 2016.

SELECT
  p.accession_pedigree_id,
  p.accession_id,
  p.male_accession_id,
  p.male_external_accession,
  p.female_accession_id,
  p.female_external_accession,
  p.cross_code,
  p.description,
  p.released_date_code,
  p.released_date,
  (SELECT taxonomy_species_id FROM accession acc WHERE (p.accession_id = acc.accession_id)) AS taxonomy_species_id,
  p.created_date,
  p.created_by,
  p.modified_date,
  p.modified_by,
  p.owned_date,
  p.owned_by
FROM
    accession_pedigree p
    INNER JOIN (
	SELECT accession_pedigree_id FROM accession_pedigree
            WHERE accession_pedigree_id in (:accessionpedigreeid)

	UNION SELECT accession_pedigree_id FROM accession_pedigree
            WHERE accession_id in (:accessionid)

	UNION SELECT accession_pedigree_id FROM accession_pedigree
            WHERE male_accession_id in (:accessionid)

	UNION SELECT accession_pedigree_id FROM accession_pedigree
            WHERE female_accession_id in (:accessionid)

	UNION SELECT accession_pedigree_id FROM accession_pedigree
            INNER JOIN inventory ON accession_pedigree.accession_id = inventory.accession_id
            WHERE inventory.inventory_id in (:inventoryid)

	UNION SELECT accession_pedigree_id FROM accession_pedigree
            INNER JOIN inventory ON accession_pedigree.accession_id = inventory.accession_id
            INNER JOIN order_request_item ON inventory.inventory_id = order_request_item.inventory_id
            WHERE order_request_item.order_request_id in (:orderrequestid)

	UNION SELECT accession_pedigree_id FROM accession_pedigree
            INNER JOIN accession ON accession_pedigree.accession_id = accession.accession_id
            WHERE accession.taxonomy_species_id in (:taxonomyspeciesid)

	UNION SELECT accession_pedigree_id FROM accession_pedigree
            INNER JOIN accession ON accession_pedigree.accession_id = accession.accession_id
            INNER JOIN taxonomy_species ON accession.taxonomy_species_id = taxonomy_species.taxonomy_species_id
            WHERE taxonomy_species.taxonomy_genus_id in (:taxonomygenusid)

    ) list ON p.accession_pedigree_id = list.accession_pedigree_id

comment:3 by Benjamin Haag, 6 weeks ago

Correction -- backups located and imported.

Note: See TracTickets for help on using tickets.