Skip to content

Commit

Permalink
Added the profile email domain view, as well as fixed the notificatio…
Browse files Browse the repository at this point in the history
…n view include (#7073)
  • Loading branch information
Camelia-Orcid authored Aug 26, 2024
1 parent c9d9f39 commit a56f649
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
3 changes: 2 additions & 1 deletion orcid-persistence/src/main/resources/db-master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -401,5 +401,6 @@
<include file="/db/updates/identifier-types/identifier-type-52-RAiD.xml" />
<include file="/db/updates/add_fail_count_fail_reason_and_sync_date_to_group_id_record.xml" />
<include file="/db/updates/create_profile_email_domain_table.xml" />
<include file="/db/updates/create_dw_research_resource_with_dates.xml" />
<include file="/db/updates/create_dw_notification.xml" />
<include file="/db/updates/create_dw_profile_email_domain.xml" />
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<changeSet id="CREATE-DW-NOTIFICATION" author="Camelia Dumitru" dbms="postgresql">
<createView viewName="dw_notification" replaceIfExists="true">
select notification_type, orcid, client_source_id, date_created, sent_date, read_date, actioned_date, archived_date, last_modified
select id as db_id, notification_type, orcid, client_source_id, date_created, sent_date, read_date, actioned_date, archived_date, last_modified
from notification where notification_type='PERMISSION' and client_source_id is not null and last_modified > date_trunc('day',(now() - interval '12 months'))
</createView>
</changeSet>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">


<changeSet id="CREATE-DW-PROFILE-EMAIL-DOMAIN" author="Camelia Dumitru" dbms="postgresql">
<createView viewName="dw_profile_email_domain" replaceIfExists="true">
select id as db_id, orcid, email_domain, visibility,date_created, last_modified from profile_email_domain where last_modified > date_trunc('day',(now() - interval '4 months'))
</createView>
</changeSet>

<changeSet id="GRANT-READ_PERM-TO-DW-PROFILE-EMAIL-DOMAIN" author="Camelia Dumitru" dbms="postgresql">
<preConditions>
<sqlCheck expectedResult="1">SELECT 1 FROM pg_roles WHERE rolname='dw_user'</sqlCheck>
</preConditions>
<sql>GRANT SELECT ON TABLE dw_profile_email_domain to dw_user;</sql>
</changeSet>

</databaseChangeLog>

0 comments on commit a56f649

Please sign in to comment.