Skip to content

Conversation

@sthelemann
Copy link
Contributor

A table vibetype.invitation was added that inherits from table notificationwhich was moved from schema maevsi_private to schema maevsi. In orrder to make functions that were originally created in test_account_blocking.sql generally available for all tests (including tests for invitations), these functions were moved to function_test_utilities.sql.

A table `vibetype.invitation` was added that inherits from table `notification`which was moved from schema `maevsi_private` to schema `maevsi`.
In orrder to make functions that were originally created in `test_account_blocking.sql` generally available for all tests (including tests for invitations), these functions were moved to `function_test_utilities.sql`.
@sthelemann sthelemann requested a review from dargmuesli March 19, 2025 22:31
@dargmuesli dargmuesli changed the base branch from main to beta March 20, 2025 00:13
@dargmuesli dargmuesli changed the title feat(invitation): add invitations feat(notification)!: inherit invitations Mar 20, 2025
@dargmuesli dargmuesli mentioned this pull request Mar 25, 2025
@dargmuesli dargmuesli linked an issue Mar 25, 2025 that may be closed by this pull request
In `function_test_utilities.sql' many functions set the role back to the session user at their end. We use `SET LOCAL ROLE NONE`to be independent of any real user name.
Switching back to the login role can be done with ` SET LOCAL ROLE NONE`.
Table `invitation` has been renamed to `notification_invitation`.
The functions `vibetype_test.account_create` and `vibetype_test.contact_create` must run in mode SECURITY DEFINER in order to work when not logged in as the owner of the database objects.
Column `created_by` was moved from table `notification_invitation` to table `notification`.
Row level security was added to table `notification`.
Some modifications were made to functions in `function_test_utilities.sql`.
Base automatically changed from beta to main April 7, 2025 20:44
The policies for tables `notification` and `notification_invitation` were updated to make use of `FOR ALL` policies.
@dargmuesli dargmuesli changed the base branch from main to beta April 25, 2025 04:06
For tables `vibetype.notification` and `vibetype.notification_invitation` the policies were moved to the table files, making the policy files obsolete.
@dargmuesli dargmuesli self-requested a review April 30, 2025 08:17
Comment on lines 17 to 20
CREATE POLICY notification_invitation_all ON vibetype.notification_invitation FOR ALL
USING (
created_by = vibetype.invoker_account_id()
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this covered by the parent table?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, see Postgreqsl documentation, section 5.11: "In a similar way, the parent table's row security policies (see Section 5.9) are applied to rows coming from child tables during an inherited query. A child table's policies, if any, are applied only when it is the table explicitly named in the query; and in that case, any policies attached to its parent(s) are ignored."

dargmuesli and others added 3 commits May 2, 2025 12:21
The function `invite` has been changed to only store the event id in the payload of the notification record.
The policy for table `notification_invitation` has been removed because it is already present for the parent table `notification`.
Function `invite`has been restored to its previous implementation regarding JSON payload.
@dargmuesli dargmuesli self-requested a review May 9, 2025 13:12
Base automatically changed from beta to main May 15, 2025 11:58
@CLAassistant
Copy link

CLAassistant commented Jun 28, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(invitation): track send events

3 participants