Fix FK violation by normalizing interviewer_id 0 to NULL#34
Merged
Conversation
Member
|
@Pavan-Kumar-KN Thanks for fixing the FK violation. Could you trim this PR down to the actual migration/app fix?
|
Contributor
Author
|
Thanks @SuveenE — I trimmed this PR to only include the migration and the app fix. Please review the changes and let me know if anything else is needed. Summary of what I changed
|
Member
|
Merging. Thanks for the fix @Pavan-Kumar-KN |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces the initial database schema for the application, establishing the core tables and relationships needed for managing organizations, users, interviews, interviewers, responses, and feedback. The schema also defines a custom enum type for organization plans.
Database schema initialization
planwith possible values:'free','pro', and'free_trial_over'to represent organization plans.organizationtable with fields for organization details, allowed responses, and plan type.usertable linked toorganization, storing user-specific information.interviewertable for storing interviewer agent profiles and attributes.interview,response, andfeedbacktables to manage interviews, their responses, and associated feedback, with appropriate foreign key relationships.This PR fixes interview create/update failures caused by
interviewer_id = 0violatinginterview_interviewer_id_fkey.Changes
Updated
src/services/interviews.service.tsinterviewer_id === 0tonullcreateInterviewandupdateInterviewAdded migration
supabase/migrations/20260520101000_normalize_interviewer_id.sqlNEW.interviewer_id = 0toNULLBEFORE INSERT OR UPDATEforinterviewFixes #35
Closes #35