-
Notifications
You must be signed in to change notification settings - Fork 144
Add organization_id to review_feedback_knowledge_suggestion_mappings #1501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add organization_id to review_feedback_knowledge_suggestion_mappings #1501
Conversation
…pings Co-Authored-By: [email protected] <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
…dback_knowledge_suggestion_mappings
…feedback-knowledge-suggestion-mappings
|
||
ALTER TABLE "public"."review_feedback_knowledge_suggestion_mappings" ENABLE ROW LEVEL SECURITY; | ||
|
||
CREATE POLICY "authenticated_users_can_select_org_review_feedback_knowledge_suggestion_mappings" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Authenticated users can only view review–knowledge mappings that belong to organizations they are members of.
- Service role can read and insert all review–knowledge mappings without restriction.
If you're curious where this table is used, try grepping for.from('review_feedback_knowledge_suggestion_mappings')
in the codebase.
This migration adds an organization_id column to review_feedback_knowledge_suggestion_mappings along with a trigger and updated RLS policies to enforce organization-based data isolation. A key concern is ensuring that every row has a valid organization_id, especially for cases where both knowledge_suggestion_id and review_feedback_id are null, and the subqueries used may impact performance on large datasets. Overall, the changes are well-structured and improve security and consistency, though additional safeguards and performance checks are recommended. ER Diagram: |
This migration adds an organization_id column to review_feedback_knowledge_suggestion_mappings with trigger functions and enhanced RLS policies for organization-based data isolation. A few concerns include potential performance impacts from the subquery usage in the trigger and a need to confirm naming consistency with project standards. Overall, the migration is atomic, security‐focused, and improves data integrity. ER Diagram: |
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Add organization_id to review_feedback_knowledge_suggestion_mappings
Description
This PR adds an
organization_id
column to thereview_feedback_knowledge_suggestion_mappings
table with appropriate triggers and RLS policies, following the organization-based security pattern described in the ADR.Changes
organization_id
column toreview_feedback_knowledge_suggestion_mappings
tableorganization_id
based on related tablesLink to Devin run
https://app.devin.ai/sessions/819cf5a762ef4f2f81ac65f90694473e
Requested by
[email protected]