-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(invitation): provide flattened invitations
A view is created that provides invitation data together with corresponding even and contact data.
- Loading branch information
1 parent
c55cd8f
commit 4ff342c
Showing
5 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- Deploy maevsi:view_invitation_flat to pg | ||
-- requires: schema_public | ||
-- requires: table_invitation | ||
-- requires: table_contact | ||
|
||
BEGIN; | ||
CREATE VIEW maevsi.invitation_flat AS | ||
SELECT i.*, | ||
c.account_id as contact_account_id, c.address, c.author_account_id as contact_author_account_id, c.email_address, c.email_address_hash, | ||
c.first_name, c.last_name, c.phone_number, c.url as contact_url, | ||
e.author_account_id as event_author_account_id, e.description, e.start, e.end, | ||
e.invitee_count_maximum, e.is_archived, e.is_in_person, e.is_remote, | ||
e.location, e.name, e.slug, e.url as event_url, e.visibility | ||
FROM maevsi.invitation i | ||
JOIN maevsi.contact c ON i.contact_id = c.id | ||
JOIN maevsi.event e ON i.event_id = e.id | ||
; | ||
|
||
COMMENT ON VIEW maevsi.invitation_flat IS 'View returning flattened invitations.'; | ||
|
||
END; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- Revert maevsi:view_invitation_flat from pg | ||
|
||
BEGIN; | ||
|
||
DROP VIEW maevsi.invitation_flat; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,3 +71,4 @@ table_report [schema_public table_account_public table_event table_upload] 1970- | |
table_report_policy [schema_public table_report role_account] 1970-01-01T00:00:00Z Marlon <[email protected]> # Access policies for reports. | ||
table_legal_term [schema_public role_account role_anonymous] 1970-01-01T00:00:00Z Jonas Thelemann <e-mail+maevsi/[email protected]> # Legal terms like privacy policies or terms of service. | ||
table_legal_term_acceptance [schema_public table_account_public table_legal_term role_account] 1970-01-01T00:00:00Z Jonas Thelemann <e-mail+maevsi/[email protected]> # Tracks each user account's acceptance of legal terms and conditions. | ||
view_invitation_flat [schema_public table_invitation table_contact role_account] 1970-01-01T00:00:00Z Sven Thelemann <[email protected]> # View returning flattened invitations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-- Verify maevsi:view_invitation_flat on pg | ||
|
||
BEGIN; | ||
|
||
SELECT | ||
id, contact_id, event_id, feedback, feedback_paper, | ||
contact_account_id, address, contact_author_account_id, email_address, email_address_hash, | ||
first_name, last_name, phone_number, contact_url, | ||
event_author_account_id, description, "start", "end", | ||
invitee_count_maximum, is_archived, is_in_person, is_remote, | ||
location, name, slug, event_url, visibility | ||
FROM maevsi.invitation_flat WHERE FALSE; | ||
|
||
ROLLBACK; |