https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38822

--- Comment #28 from Matt Blenkinsop <[email protected]> ---
Created attachment 210289
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210289&action=edit
Bug 38822: Add a period index and the erm_counter_log_summary table

The data providers summary page needs one row per usage data provider,
report type and harvest year, with the status of the latest counter log
for each month. This patch adds the database side of that:

- An index on erm_counter_logs (usage_data_provider_id, report_type,
  report_year, report_month), the natural key of a harvested month. It
  serves the rebuild of the summary, the Import logs tab and the retry
  lookup.
- A table erm_counter_log_summary, in kohastructure.sql after
  erm_usage_yus. It has one row per provider, report type and year (a
  unique key) and the status of each month in month_1 to month_12. The
  next patches rebuild its rows from erm_counter_logs: the newest log of
  each month (by importdate, then id) gives the status of the month.
  Logs without a single-month period (multi-month harvests, uploads
  covering several months) are not included. The provider name is not
  stored, the API joins it.

The atomicupdate creates the table and fills it from the existing
counter logs. It also drops a view of that name, which an earlier
version of this patch left in development databases.

updatedatabase runs the atomicupdate files in name order, so this file
runs before bug_41307.pl, which adds the report_type, report_year,
report_month and status columns the index and the table read. The file
adds them too, under the same guards, so the first run of updatedatabase
works in either order and the file that runs second skips them.

Sponsored-by: Karlsruhe Institute of Technology (KIT)
Assisted-by: Fable 5.1 (Anthropic)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to