From 763a8da39b863274fb66c282164c940fdc9903aa Mon Sep 17 00:00:00 2001 From: Daniel Palafox Date: Tue, 31 Oct 2023 19:26:13 -0500 Subject: [PATCH] fix: Add missing `last_modified` in events view so panoply can run successfully --- .../src/main/resources/db-master.xml | 1 + .../resources/db/updates/dw_alter_event.xml | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 orcid-persistence/src/main/resources/db/updates/dw_alter_event.xml diff --git a/orcid-persistence/src/main/resources/db-master.xml b/orcid-persistence/src/main/resources/db-master.xml index f2c56e0432d..da8321423b4 100644 --- a/orcid-persistence/src/main/resources/db-master.xml +++ b/orcid-persistence/src/main/resources/db-master.xml @@ -377,4 +377,5 @@ + diff --git a/orcid-persistence/src/main/resources/db/updates/dw_alter_event.xml b/orcid-persistence/src/main/resources/db/updates/dw_alter_event.xml new file mode 100644 index 00000000000..d7b9c53608e --- /dev/null +++ b/orcid-persistence/src/main/resources/db/updates/dw_alter_event.xml @@ -0,0 +1,43 @@ + + + + + + + SELECT event_type, client_id, COUNT(id), DATE_TRUNC('day', date_created), DATE_TRUNC('day', date_created) as last_modified + FROM event + WHERE event_type != 'Public-Page' + GROUP BY event_type, client_id, DATE_TRUNC('day', date_created) + ORDER BY DATE_TRUNC('day', date_created) DESC; + + + + + + SELECT 1 FROM pg_roles WHERE rolname='dw_user' + + GRANT SELECT ON TABLE dw_event to dw_user; + + + + + + + SELECT event_type, public_page, COUNT(id), DATE_TRUNC('day', date_created), DATE_TRUNC('day', date_created) as last_modified + FROM event + WHERE event_type = 'Public-Page' + GROUP BY event_type, public_page, DATE_TRUNC('day', date_created) + ORDER BY DATE_TRUNC('day', date_created) DESC; + + + + + + SELECT 1 FROM pg_roles WHERE rolname='dw_user' + + GRANT SELECT ON TABLE dw_event_public_page to dw_user; + + +