BiologicalRecordsCentre / UKBMS-online

Issue tracking for UKBMS online recording site
2 stars 0 forks source link

order of species on Annual Summary table #287

Closed IanMiddlebrook closed 1 year ago

IanMiddlebrook commented 1 year ago

Hi @DavidRoy,

a branch co-ordinator has pointed out that the order of species on the Annual Summary tables can vary depending on year and 'filter by recorder' as follows:

Meadow Brown, Small Heath & Ringlet for 2020 and before, Small Heath Meadow Brown and Ringlet for branch sites and Meadow Brown, Small Heath and Ringlet for individual sites in 2021 Meadow Brown, Ringlet and Small Heath for branch reports and also for separate sites in 2022

It looks like the 2022 tables behave as preferred (ref issue #247 )

It would be helpful to co-ordinators if all years presented specie in the same order.

Thanks, Ian

Gary-van-Breda commented 1 year ago

This is a hangover from #247. The sort order is part of the cached summary data, so the data that was generated before #247 has a different order to that generated after. Things may be a bit strange for the branch sites as these are a conglomeration of multiple sites, so it will depend when the data is retrieved from the database.

I will need to do a rebuild of the summary data up to and including 2021 (add a task to the job queue for each user/year/location combination).

Gary-van-Breda commented 1 year ago
INSERT INTO indicia.work_queue (task, entity, record_id, priority, cost_estimate, created_on)
  SELECT 'task_summary_builder_sample', 'sample', min(id), 3, 50, now()
  FROM indicia.samples
  WHERE parent_id is null and survey_id in (64, 305, 306) and deleted = false
  AND extract(YEAR from date_start) <= 2021
  group by location_id, created_by_id, extract(YEAR from date_start);
Gary-van-Breda commented 1 year ago

Catch up now complete. It is now showing order Meadow Brown/Ringlet/Small Heath/Large Heath on all.

@IanMiddlebrook : can you review and close if you are happy?

IanMiddlebrook commented 1 year ago

Thanks