Queued Ingest needs to call the function behind the non-QI simple report
data trigger. This commit updates the core QI function to make sure
that happens.
In order to address any outstanding records, either refresh the reporter
data by calling the existing database function for that purpose:
or generate a script to directly process records that have been through
QI, similar to the following psql script:
\t
\o /tmp/update_reporter_data.sql
WITH last_update AS (
SELECT record, max(ingest_time)
FROM action.ingest_queue_entry
WHERE fail_time IS NULL
AND override_by IS NULL
AND record_type = 'biblio'
GROUP BY 1
), last_action AS (
SELECT qi.record, qi.action
FROM action.ingest_queue_entry qi, last_update
WHERE qi.record = last_update.record
AND qi.record_type = 'biblio'
AND qi.ingest_time = last_update.max
) SELECT DISTINCT 'select reporter.simple_rec_update('||record||', $$delete$$=$$'||action||'$$)'
FROM last_action
ORDER BY 1;
Branch available at: https:/ /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ miker/lp- 2066981- QI-vs-reporting -data
From the commit message:
LP#2066981: Queued Ingest vs reporter data
Queued Ingest needs to call the function behind the non-QI simple report
data trigger. This commit updates the core QI function to make sure
that happens.
In order to address any outstanding records, either refresh the reporter
data by calling the existing database function for that purpose:
SELECT reporter. refresh_ materialized_ simple_ record( );
or generate a script to directly process records that have been through
QI, similar to the following psql script:
\t reporter_ data.sql
\o /tmp/update_
WITH last_update AS ( ingest_ queue_entry ingest_ queue_entry qi,
last_ update simple_ rec_update( '||record| |', $$delete$ $=$$'|| action| |'$$)'
SELECT record, max(ingest_time)
FROM action.
WHERE fail_time IS NULL
AND override_by IS NULL
AND record_type = 'biblio'
GROUP BY 1
), last_action AS (
SELECT qi.record, qi.action
FROM action.
WHERE qi.record = last_update.record
AND qi.record_type = 'biblio'
AND qi.ingest_time = last_update.max
) SELECT DISTINCT 'select reporter.
FROM last_action
ORDER BY 1;
\t reporter_ data.sql
\o
\i /tmp/update_