chore: heygermany customer project
Some checks failed
Main / Setup and Test (push) Has been cancelled
Main / Build Website (push) Has been cancelled

This commit is contained in:
e2e
2026-07-11 11:13:08 +02:00
commit 2c4174b44b
370 changed files with 35601 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
-- Add ON DELETE CASCADE to all foreign key constraints referencing candidate_document
-- This allows deleting documents without violating foreign key constraints
-- Drop and recreate foreign key constraints with ON DELETE CASCADE
-- 1. candidate_education.source_document_id
ALTER TABLE app.candidate_education
DROP CONSTRAINT IF EXISTS candidate_education_source_document_id_fkey;
ALTER TABLE app.candidate_education
ADD CONSTRAINT candidate_education_source_document_id_fkey
FOREIGN KEY (source_document_id)
REFERENCES app.candidate_document(document_id)
ON DELETE CASCADE;
-- 2. candidate_transcript.source_document_id
ALTER TABLE app.candidate_transcript
DROP CONSTRAINT IF EXISTS candidate_transcript_source_document_id_fkey;
ALTER TABLE app.candidate_transcript
ADD CONSTRAINT candidate_transcript_source_document_id_fkey
FOREIGN KEY (source_document_id)
REFERENCES app.candidate_document(document_id)
ON DELETE CASCADE;
-- 3. candidate_license.source_document_id
ALTER TABLE app.candidate_license
DROP CONSTRAINT IF EXISTS candidate_license_source_document_id_fkey;
ALTER TABLE app.candidate_license
ADD CONSTRAINT candidate_license_source_document_id_fkey
FOREIGN KEY (source_document_id)
REFERENCES app.candidate_document(document_id)
ON DELETE CASCADE;
-- 4. candidate_language.source_document_id
ALTER TABLE app.candidate_language
DROP CONSTRAINT IF EXISTS candidate_language_source_document_id_fkey;
ALTER TABLE app.candidate_language
ADD CONSTRAINT candidate_language_source_document_id_fkey
FOREIGN KEY (source_document_id)
REFERENCES app.candidate_document(document_id)
ON DELETE CASCADE;
-- 5. candidate_experience.source_document_id
ALTER TABLE app.candidate_experience
DROP CONSTRAINT IF EXISTS candidate_experience_source_document_id_fkey;
ALTER TABLE app.candidate_experience
ADD CONSTRAINT candidate_experience_source_document_id_fkey
FOREIGN KEY (source_document_id)
REFERENCES app.candidate_document(document_id)
ON DELETE CASCADE;