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; + + +