-- Name: xnat_mgsessiondata a_u_xnat_mgsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_mgsessiondata AFTER DELETE OR UPDATE ON public.xnat_mgsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_mgsessiondata();


--
-- Name: xnat_mrassessordata a_u_xnat_mrassessordata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_mrassessordata AFTER DELETE OR UPDATE ON public.xnat_mrassessordata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_mrassessordata();


--
-- Name: xnat_mrqcscandata a_u_xnat_mrqcscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_mrqcscandata AFTER DELETE OR UPDATE ON public.xnat_mrqcscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_mrqcscandata();


--
-- Name: xnat_mrscandata a_u_xnat_mrscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_mrscandata AFTER DELETE OR UPDATE ON public.xnat_mrscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_mrscandata();


--
-- Name: xnat_mrsessiondata a_u_xnat_mrsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_mrsessiondata AFTER DELETE OR UPDATE ON public.xnat_mrsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_mrsessiondata();


--
-- Name: xnat_mrsscandata a_u_xnat_mrsscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_mrsscandata AFTER DELETE OR UPDATE ON public.xnat_mrsscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_mrsscandata();


--
-- Name: xnat_nmscandata a_u_xnat_nmscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_nmscandata AFTER DELETE OR UPDATE ON public.xnat_nmscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_nmscandata();


--
-- Name: xnat_nmsessiondata a_u_xnat_nmsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_nmsessiondata AFTER DELETE OR UPDATE ON public.xnat_nmsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_nmsessiondata();


--
-- Name: xnat_opscandata a_u_xnat_opscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_opscandata AFTER DELETE OR UPDATE ON public.xnat_opscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_opscandata();


--
-- Name: xnat_opsessiondata a_u_xnat_opsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_opsessiondata AFTER DELETE OR UPDATE ON public.xnat_opsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_opsessiondata();


--
-- Name: xnat_optscandata a_u_xnat_optscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_optscandata AFTER DELETE OR UPDATE ON public.xnat_optscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_optscandata();


--
-- Name: xnat_optsessiondata a_u_xnat_optsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_optsessiondata AFTER DELETE OR UPDATE ON public.xnat_optsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_optsessiondata();


--
-- Name: xnat_otherdicomscandata a_u_xnat_otherdicomscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_otherdicomscandata AFTER DELETE OR UPDATE ON public.xnat_otherdicomscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_otherdicomscandata();


--
-- Name: xnat_otherdicomsessiondata a_u_xnat_otherdicomsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_otherdicomsessiondata AFTER DELETE OR UPDATE ON public.xnat_otherdicomsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_otherdicomsessiondata();


--
-- Name: xnat_otherqcscandata a_u_xnat_otherqcscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_otherqcscandata AFTER DELETE OR UPDATE ON public.xnat_otherqcscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_otherqcscandata();


--
-- Name: xnat_petassessordata a_u_xnat_petassessordata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_petassessordata AFTER DELETE OR UPDATE ON public.xnat_petassessordata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_petassessordata();


--
-- Name: xnat_petmrsessiondata a_u_xnat_petmrsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_petmrsessiondata AFTER DELETE OR UPDATE ON public.xnat_petmrsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_petmrsessiondata();


--
-- Name: xnat_petqcscandata a_u_xnat_petqcscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_petqcscandata AFTER DELETE OR UPDATE ON public.xnat_petqcscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_petqcscandata();


--
-- Name: xnat_petqcscandata_processingerror a_u_xnat_petqcscandata_processingerror; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_petqcscandata_processingerror AFTER DELETE OR UPDATE ON public.xnat_petqcscandata_processingerror FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_petqcscandata_processingerror();


--
-- Name: xnat_petscandata a_u_xnat_petscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_petscandata AFTER DELETE OR UPDATE ON public.xnat_petscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_petscandata();


--
-- Name: xnat_petscandata_frame a_u_xnat_petscandata_frame; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_petscandata_frame AFTER DELETE OR UPDATE ON public.xnat_petscandata_frame FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_petscandata_frame();


--
-- Name: xnat_petsessiondata a_u_xnat_petsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_petsessiondata AFTER DELETE OR UPDATE ON public.xnat_petsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_petsessiondata();


--
-- Name: xnat_projectdata a_u_xnat_projectdata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_projectdata AFTER DELETE OR UPDATE ON public.xnat_projectdata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_projectdata();


--
-- Name: xnat_projectdata_alias a_u_xnat_projectdata_alias; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_projectdata_alias AFTER DELETE OR UPDATE ON public.xnat_projectdata_alias FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_projectdata_alias();


--
-- Name: xnat_projectdata_field a_u_xnat_projectdata_field; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_projectdata_field AFTER DELETE OR UPDATE ON public.xnat_projectdata_field FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_projectdata_field();


--
-- Name: xnat_projectparticipant a_u_xnat_projectparticipant; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_projectparticipant AFTER DELETE OR UPDATE ON public.xnat_projectparticipant FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_projectparticipant();


--
-- Name: xnat_publicationresource a_u_xnat_publicationresource; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_publicationresource AFTER DELETE OR UPDATE ON public.xnat_publicationresource FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_publicationresource();


--
-- Name: xnat_pvisitdata a_u_xnat_pvisitdata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_pvisitdata AFTER DELETE OR UPDATE ON public.xnat_pvisitdata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_pvisitdata();


--
-- Name: xnat_qcassessmentdata a_u_xnat_qcassessmentdata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_qcassessmentdata AFTER DELETE OR UPDATE ON public.xnat_qcassessmentdata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_qcassessmentdata();


--
-- Name: xnat_qcassessmentdata_scan a_u_xnat_qcassessmentdata_scan; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_qcassessmentdata_scan AFTER DELETE OR UPDATE ON public.xnat_qcassessmentdata_scan FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_qcassessmentdata_scan();


--
-- Name: xnat_qcassessmentdata_scan_slice a_u_xnat_qcassessmentdata_scan_slice; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_qcassessmentdata_scan_slice AFTER DELETE OR UPDATE ON public.xnat_qcassessmentdata_scan_slice FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_qcassessmentdata_scan_slice();


--
-- Name: xnat_qcmanualassessordata a_u_xnat_qcmanualassessordata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_qcmanualassessordata AFTER DELETE OR UPDATE ON public.xnat_qcmanualassessordata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_qcmanualassessordata();


--
-- Name: xnat_qcscandata a_u_xnat_qcscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_qcscandata AFTER DELETE OR UPDATE ON public.xnat_qcscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_qcscandata();


--
-- Name: xnat_qcscandata_field a_u_xnat_qcscandata_field; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_qcscandata_field AFTER DELETE OR UPDATE ON public.xnat_qcscandata_field FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_qcscandata_field();


--
-- Name: xnat_reconstructedimagedata a_u_xnat_reconstructedimagedata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_reconstructedimagedata AFTER DELETE OR UPDATE ON public.xnat_reconstructedimagedata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_reconstructedimagedata();


--
-- Name: xnat_reconstructedimagedata_scanid a_u_xnat_reconstructedimagedata_scanid; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_reconstructedimagedata_scanid AFTER DELETE OR UPDATE ON public.xnat_reconstructedimagedata_scanid FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_reconstructedimagedata_scanid();


--
-- Name: xnat_regionresource a_u_xnat_regionresource; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_regionresource AFTER DELETE OR UPDATE ON public.xnat_regionresource FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_regionresource();


--
-- Name: xnat_regionresource_label a_u_xnat_regionresource_label; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_regionresource_label AFTER DELETE OR UPDATE ON public.xnat_regionresource_label FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_regionresource_label();


--
-- Name: xnat_resource a_u_xnat_resource; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_resource AFTER DELETE OR UPDATE ON public.xnat_resource FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_resource();


--
-- Name: xnat_resourcecatalog a_u_xnat_resourcecatalog; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_resourcecatalog AFTER DELETE OR UPDATE ON public.xnat_resourcecatalog FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_resourcecatalog();


--
-- Name: xnat_resourceseries a_u_xnat_resourceseries; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_resourceseries AFTER DELETE OR UPDATE ON public.xnat_resourceseries FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_resourceseries();


--
-- Name: xnat_rfscandata a_u_xnat_rfscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_rfscandata AFTER DELETE OR UPDATE ON public.xnat_rfscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_rfscandata();


--
-- Name: xnat_rfsessiondata a_u_xnat_rfsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_rfsessiondata AFTER DELETE OR UPDATE ON public.xnat_rfsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_rfsessiondata();


--
-- Name: xnat_rtimagescandata a_u_xnat_rtimagescandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_rtimagescandata AFTER DELETE OR UPDATE ON public.xnat_rtimagescandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_rtimagescandata();


--
-- Name: xnat_rtsessiondata a_u_xnat_rtsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_rtsessiondata AFTER DELETE OR UPDATE ON public.xnat_rtsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_rtsessiondata();


--
-- Name: xnat_scscandata a_u_xnat_scscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_scscandata AFTER DELETE OR UPDATE ON public.xnat_scscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_scscandata();


--
-- Name: xnat_segscandata a_u_xnat_segscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_segscandata AFTER DELETE OR UPDATE ON public.xnat_segscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_segscandata();


--
-- Name: xnat_smscandata a_u_xnat_smscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_smscandata AFTER DELETE OR UPDATE ON public.xnat_smscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_smscandata();


--
-- Name: xnat_smsessiondata a_u_xnat_smsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_smsessiondata AFTER DELETE OR UPDATE ON public.xnat_smsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_smsessiondata();


--
-- Name: xnat_srscandata a_u_xnat_srscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_srscandata AFTER DELETE OR UPDATE ON public.xnat_srscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_srscandata();


--
-- Name: xnat_srsessiondata a_u_xnat_srsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_srsessiondata AFTER DELETE OR UPDATE ON public.xnat_srsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_srsessiondata();


--
-- Name: xnat_statisticsdata a_u_xnat_statisticsdata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_statisticsdata AFTER DELETE OR UPDATE ON public.xnat_statisticsdata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_statisticsdata();


--
-- Name: xnat_statisticsdata_addfield a_u_xnat_statisticsdata_addfield; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_statisticsdata_addfield AFTER DELETE OR UPDATE ON public.xnat_statisticsdata_addfield FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_statisticsdata_addfield();


--
-- Name: xnat_statisticsdata_additionalstatistics a_u_xnat_statisticsdata_additionalstatistics; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_statisticsdata_additionalstatistics AFTER DELETE OR UPDATE ON public.xnat_statisticsdata_additionalstatistics FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_statisticsdata_additionalstatistics();


--
-- Name: xnat_studyprotocol a_u_xnat_studyprotocol; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_studyprotocol AFTER DELETE OR UPDATE ON public.xnat_studyprotocol FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_studyprotocol();


--
-- Name: xnat_studyprotocol_condition a_u_xnat_studyprotocol_condition; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_studyprotocol_condition AFTER DELETE OR UPDATE ON public.xnat_studyprotocol_condition FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_studyprotocol_condition();


--
-- Name: xnat_studyprotocol_group a_u_xnat_studyprotocol_group; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_studyprotocol_group AFTER DELETE OR UPDATE ON public.xnat_studyprotocol_group FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_studyprotocol_group();


--
-- Name: xnat_studyprotocol_session a_u_xnat_studyprotocol_session; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_studyprotocol_session AFTER DELETE OR UPDATE ON public.xnat_studyprotocol_session FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_studyprotocol_session();


--
-- Name: xnat_studyprotocol_variable a_u_xnat_studyprotocol_variable; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_studyprotocol_variable AFTER DELETE OR UPDATE ON public.xnat_studyprotocol_variable FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_studyprotocol_variable();


--
-- Name: xnat_subjectassessordata a_u_xnat_subjectassessordata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_subjectassessordata AFTER DELETE OR UPDATE ON public.xnat_subjectassessordata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_subjectassessordata();


--
-- Name: xnat_subjectdata a_u_xnat_subjectdata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_subjectdata AFTER DELETE OR UPDATE ON public.xnat_subjectdata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_subjectdata();


--
-- Name: xnat_subjectdata_addid a_u_xnat_subjectdata_addid; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_subjectdata_addid AFTER DELETE OR UPDATE ON public.xnat_subjectdata_addid FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_subjectdata_addid();


--
-- Name: xnat_subjectdata_field a_u_xnat_subjectdata_field; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_subjectdata_field AFTER DELETE OR UPDATE ON public.xnat_subjectdata_field FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_subjectdata_field();


--
-- Name: xnat_subjectmetadata a_u_xnat_subjectmetadata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_subjectmetadata AFTER DELETE OR UPDATE ON public.xnat_subjectmetadata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_subjectmetadata();


--
-- Name: xnat_subjectvariablesdata a_u_xnat_subjectvariablesdata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_subjectvariablesdata AFTER DELETE OR UPDATE ON public.xnat_subjectvariablesdata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_subjectvariablesdata();


--
-- Name: xnat_subjectvariablesdata_variable a_u_xnat_subjectvariablesdata_variable; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_subjectvariablesdata_variable AFTER DELETE OR UPDATE ON public.xnat_subjectvariablesdata_variable FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_subjectvariablesdata_variable();


--
-- Name: xnat_usscandata a_u_xnat_usscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_usscandata AFTER DELETE OR UPDATE ON public.xnat_usscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_usscandata();


--
-- Name: xnat_ussessiondata a_u_xnat_ussessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_ussessiondata AFTER DELETE OR UPDATE ON public.xnat_ussessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_ussessiondata();


--
-- Name: xnat_validationdata a_u_xnat_validationdata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_validationdata AFTER DELETE OR UPDATE ON public.xnat_validationdata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_validationdata();


--
-- Name: xnat_voiceaudioscandata a_u_xnat_voiceaudioscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_voiceaudioscandata AFTER DELETE OR UPDATE ON public.xnat_voiceaudioscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_voiceaudioscandata();


--
-- Name: xnat_volumetricregion a_u_xnat_volumetricregion; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_volumetricregion AFTER DELETE OR UPDATE ON public.xnat_volumetricregion FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_volumetricregion();


--
-- Name: xnat_volumetricregion_subregion a_u_xnat_volumetricregion_subregion; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_volumetricregion_subregion AFTER DELETE OR UPDATE ON public.xnat_volumetricregion_subregion FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_volumetricregion_subregion();


--
-- Name: xnat_xa3dscandata a_u_xnat_xa3dscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_xa3dscandata AFTER DELETE OR UPDATE ON public.xnat_xa3dscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_xa3dscandata();


--
-- Name: xnat_xa3dsessiondata a_u_xnat_xa3dsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_xa3dsessiondata AFTER DELETE OR UPDATE ON public.xnat_xa3dsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_xa3dsessiondata();


--
-- Name: xnat_xascandata a_u_xnat_xascandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_xascandata AFTER DELETE OR UPDATE ON public.xnat_xascandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_xascandata();


--
-- Name: xnat_xasessiondata a_u_xnat_xasessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_xasessiondata AFTER DELETE OR UPDATE ON public.xnat_xasessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_xasessiondata();


--
-- Name: xnat_xcscandata a_u_xnat_xcscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_xcscandata AFTER DELETE OR UPDATE ON public.xnat_xcscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_xcscandata();


--
-- Name: xnat_xcsessiondata a_u_xnat_xcsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_xcsessiondata AFTER DELETE OR UPDATE ON public.xnat_xcsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_xcsessiondata();


--
-- Name: xnat_xcvscandata a_u_xnat_xcvscandata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_xcvscandata AFTER DELETE OR UPDATE ON public.xnat_xcvscandata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_xcvscandata();


--
-- Name: xnat_xcvsessiondata a_u_xnat_xcvsessiondata; Type: TRIGGER; Schema: public; Owner: xnat
--

CREATE TRIGGER a_u_xnat_xcvsessiondata AFTER DELETE OR UPDATE ON public.xnat_xcvsessiondata FOR EACH ROW EXECUTE PROCEDURE public.after_update_xnat_xcvsessiondata();


--
-- Name: arc_archivespecification arc_archivespecification_archivespecification_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_archivespecification
    ADD CONSTRAINT arc_archivespecification_archivespecification_info_fkey FOREIGN KEY (archivespecification_info) REFERENCES public.arc_archivespecification_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_archivespecification arc_archivespecification_globalpaths_arc_pathinfo_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_archivespecification
    ADD CONSTRAINT arc_archivespecification_globalpaths_arc_pathinfo_id_fkey FOREIGN KEY (globalpaths_arc_pathinfo_id) REFERENCES public.arc_pathinfo(arc_pathinfo_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: arc_archivespecification_meta_data arc_archivespecification_meta_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_archivespecification_meta_data
    ADD CONSTRAINT arc_archivespecification_meta_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_archivespecification_meta_data arc_archivespecification_meta_dat_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_archivespecification_meta_data
    ADD CONSTRAINT arc_archivespecification_meta_dat_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_archivespecification_notification_type_meta_data arc_archivespecification_noti_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_archivespecification_notification_type_meta_data
    ADD CONSTRAINT arc_archivespecification_noti_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_archivespecification_notification_type arc_archivespecification_noti_archivespecification_notific_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_archivespecification_notification_type
    ADD CONSTRAINT arc_archivespecification_noti_archivespecification_notific_fkey FOREIGN KEY (archivespecification_notification_type_info) REFERENCES public.arc_archivespecification_notification_type_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_archivespecification_notification_type arc_archivespecification_noti_notification_types_notificat_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_archivespecification_notification_type
    ADD CONSTRAINT arc_archivespecification_noti_notification_types_notificat_fkey FOREIGN KEY (notification_types_notification_arc_archivespecification_id) REFERENCES public.arc_archivespecification(arc_archivespecification_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: arc_archivespecification_notification_type_meta_data arc_archivespecification_notifica_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_archivespecification_notification_type_meta_data
    ADD CONSTRAINT arc_archivespecification_notifica_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_fieldspecification arc_fieldspecification_fieldspecification_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_fieldspecification
    ADD CONSTRAINT arc_fieldspecification_fieldspecification_info_fkey FOREIGN KEY (fieldspecification_info) REFERENCES public.arc_fieldspecification_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_fieldspecification arc_fieldspecification_fieldspecifications_fieldspecif_ar_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_fieldspecification
    ADD CONSTRAINT arc_fieldspecification_fieldspecifications_fieldspecif_ar_fkey1 FOREIGN KEY (fieldspecifications_fieldspecif_arc_project_id) REFERENCES public.arc_project(arc_project_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: arc_fieldspecification arc_fieldspecification_fieldspecifications_fieldspecif_arc_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_fieldspecification
    ADD CONSTRAINT arc_fieldspecification_fieldspecifications_fieldspecif_arc_fkey FOREIGN KEY (fieldspecifications_fieldspecif_arc_archivespecification_id) REFERENCES public.arc_archivespecification(arc_archivespecification_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: arc_fieldspecification_meta_data arc_fieldspecification_meta_d_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_fieldspecification_meta_data
    ADD CONSTRAINT arc_fieldspecification_meta_d_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_fieldspecification_meta_data arc_fieldspecification_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_fieldspecification_meta_data
    ADD CONSTRAINT arc_fieldspecification_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_pathinfo_meta_data arc_pathinfo_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_pathinfo_meta_data
    ADD CONSTRAINT arc_pathinfo_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_pathinfo_meta_data arc_pathinfo_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_pathinfo_meta_data
    ADD CONSTRAINT arc_pathinfo_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_pathinfo arc_pathinfo_pathinfo_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_pathinfo
    ADD CONSTRAINT arc_pathinfo_pathinfo_info_fkey FOREIGN KEY (pathinfo_info) REFERENCES public.arc_pathinfo_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_pipelinedata arc_pipelinedata_extension_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_pipelinedata
    ADD CONSTRAINT arc_pipelinedata_extension_fkey FOREIGN KEY (extension) REFERENCES public.xdat_meta_element(xdat_meta_element_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_pipelinedata_meta_data arc_pipelinedata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_pipelinedata_meta_data
    ADD CONSTRAINT arc_pipelinedata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_pipelinedata_meta_data arc_pipelinedata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_pipelinedata_meta_data
    ADD CONSTRAINT arc_pipelinedata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_pipelinedata arc_pipelinedata_pipelinedata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_pipelinedata
    ADD CONSTRAINT arc_pipelinedata_pipelinedata_info_fkey FOREIGN KEY (pipelinedata_info) REFERENCES public.arc_pipelinedata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_pipelineparameterdata_meta_data arc_pipelineparameterdata_met_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_pipelineparameterdata_meta_data
    ADD CONSTRAINT arc_pipelineparameterdata_met_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_pipelineparameterdata_meta_data arc_pipelineparameterdata_meta_da_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_pipelineparameterdata_meta_data
    ADD CONSTRAINT arc_pipelineparameterdata_meta_da_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_pipelineparameterdata arc_pipelineparameterdata_parameters_parameter_arc_pipeli__fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_pipelineparameterdata
    ADD CONSTRAINT arc_pipelineparameterdata_parameters_parameter_arc_pipeli__fkey FOREIGN KEY (parameters_parameter_arc_pipeli_arc_pipelinedata_id) REFERENCES public.arc_pipelinedata(arc_pipelinedata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: arc_pipelineparameterdata arc_pipelineparameterdata_pipelineparameterdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_pipelineparameterdata
    ADD CONSTRAINT arc_pipelineparameterdata_pipelineparameterdata_info_fkey FOREIGN KEY (pipelineparameterdata_info) REFERENCES public.arc_pipelineparameterdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project_descendant_meta_data arc_project_descendant_meta_d_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_descendant_meta_data
    ADD CONSTRAINT arc_project_descendant_meta_d_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project_descendant_meta_data arc_project_descendant_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_descendant_meta_data
    ADD CONSTRAINT arc_project_descendant_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project_descendant_pipeline_meta_data arc_project_descendant_pipeli_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_descendant_pipeline_meta_data
    ADD CONSTRAINT arc_project_descendant_pipeli_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project_descendant_pipeline arc_project_descendant_pipeli_arc_project_descendant_arc_p_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_descendant_pipeline
    ADD CONSTRAINT arc_project_descendant_pipeli_arc_project_descendant_arc_p_fkey FOREIGN KEY (arc_project_descendant_arc_project_descendant_id) REFERENCES public.arc_project_descendant(arc_project_descendant_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: arc_project_descendant_pipeline arc_project_descendant_pipeli_project_descendant_pipeline__fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_descendant_pipeline
    ADD CONSTRAINT arc_project_descendant_pipeli_project_descendant_pipeline__fkey FOREIGN KEY (project_descendant_pipeline_info) REFERENCES public.arc_project_descendant_pipeline_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project_descendant_pipeline arc_project_descendant_pipeline_arc_pipelinedata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_descendant_pipeline
    ADD CONSTRAINT arc_project_descendant_pipeline_arc_pipelinedata_id_fkey FOREIGN KEY (arc_pipelinedata_id) REFERENCES public.arc_pipelinedata(arc_pipelinedata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: arc_project_descendant_pipeline_meta_data arc_project_descendant_pipeline_m_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_descendant_pipeline_meta_data
    ADD CONSTRAINT arc_project_descendant_pipeline_m_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project_descendant arc_project_descendant_pipelines_descendants_descendan_arc_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_descendant
    ADD CONSTRAINT arc_project_descendant_pipelines_descendants_descendan_arc_fkey FOREIGN KEY (pipelines_descendants_descendan_arc_project_id) REFERENCES public.arc_project(arc_project_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: arc_project_descendant arc_project_descendant_project_descendant_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_descendant
    ADD CONSTRAINT arc_project_descendant_project_descendant_info_fkey FOREIGN KEY (project_descendant_info) REFERENCES public.arc_project_descendant_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project_meta_data arc_project_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_meta_data
    ADD CONSTRAINT arc_project_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project_meta_data arc_project_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_meta_data
    ADD CONSTRAINT arc_project_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project arc_project_paths_arc_pathinfo_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project
    ADD CONSTRAINT arc_project_paths_arc_pathinfo_id_fkey FOREIGN KEY (paths_arc_pathinfo_id) REFERENCES public.arc_pathinfo(arc_pathinfo_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project_pipeline arc_project_pipeline_arc_pipelinedata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_pipeline
    ADD CONSTRAINT arc_project_pipeline_arc_pipelinedata_id_fkey FOREIGN KEY (arc_pipelinedata_id) REFERENCES public.arc_pipelinedata(arc_pipelinedata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: arc_project_pipeline_meta_data arc_project_pipeline_meta_dat_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_pipeline_meta_data
    ADD CONSTRAINT arc_project_pipeline_meta_dat_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project_pipeline_meta_data arc_project_pipeline_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_pipeline_meta_data
    ADD CONSTRAINT arc_project_pipeline_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project_pipeline arc_project_pipeline_pipelines_pipeline_arc_project_arc_pr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_pipeline
    ADD CONSTRAINT arc_project_pipeline_pipelines_pipeline_arc_project_arc_pr_fkey FOREIGN KEY (pipelines_pipeline_arc_project_arc_project_id) REFERENCES public.arc_project(arc_project_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: arc_project_pipeline arc_project_pipeline_project_pipeline_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project_pipeline
    ADD CONSTRAINT arc_project_pipeline_project_pipeline_info_fkey FOREIGN KEY (project_pipeline_info) REFERENCES public.arc_project_pipeline_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project arc_project_project_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project
    ADD CONSTRAINT arc_project_project_info_fkey FOREIGN KEY (project_info) REFERENCES public.arc_project_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_project arc_project_projects_project_arc_archivespe_arc_archivespe_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_project
    ADD CONSTRAINT arc_project_projects_project_arc_archivespe_arc_archivespe_fkey FOREIGN KEY (projects_project_arc_archivespe_arc_archivespecification_id) REFERENCES public.arc_archivespecification(arc_archivespecification_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: arc_property_meta_data arc_property_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_property_meta_data
    ADD CONSTRAINT arc_property_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_property_meta_data arc_property_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_property_meta_data
    ADD CONSTRAINT arc_property_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: arc_property arc_property_properties_property_arc_project_arc_project_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_property
    ADD CONSTRAINT arc_property_properties_property_arc_project_arc_project_i_fkey FOREIGN KEY (properties_property_arc_project_arc_project_id) REFERENCES public.arc_project(arc_project_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: arc_property arc_property_property_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.arc_property
    ADD CONSTRAINT arc_property_property_info_fkey FOREIGN KEY (property_info) REFERENCES public.arc_property_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_catalog cat_catalog_catalog_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_catalog
    ADD CONSTRAINT cat_catalog_catalog_info_fkey FOREIGN KEY (catalog_info) REFERENCES public.cat_catalog_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_catalog cat_catalog_extension_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_catalog
    ADD CONSTRAINT cat_catalog_extension_fkey FOREIGN KEY (extension) REFERENCES public.xdat_meta_element(xdat_meta_element_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_catalog_meta_data cat_catalog_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_catalog_meta_data
    ADD CONSTRAINT cat_catalog_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_catalog_meta_data cat_catalog_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_catalog_meta_data
    ADD CONSTRAINT cat_catalog_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_catalog_metafield cat_catalog_metafield_catalog_metafield_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_catalog_metafield
    ADD CONSTRAINT cat_catalog_metafield_catalog_metafield_info_fkey FOREIGN KEY (catalog_metafield_info) REFERENCES public.cat_catalog_metafield_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_catalog_metafield_meta_data cat_catalog_metafield_meta_da_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_catalog_metafield_meta_data
    ADD CONSTRAINT cat_catalog_metafield_meta_da_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_catalog_metafield_meta_data cat_catalog_metafield_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_catalog_metafield_meta_data
    ADD CONSTRAINT cat_catalog_metafield_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_catalog_metafield cat_catalog_metafield_metafields_metafield_cat_catalo_cat__fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_catalog_metafield
    ADD CONSTRAINT cat_catalog_metafield_metafields_metafield_cat_catalo_cat__fkey FOREIGN KEY (metafields_metafield_cat_catalo_cat_catalog_id) REFERENCES public.cat_catalog(cat_catalog_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: cat_catalog cat_catalog_sets_entryset_cat_catalog_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_catalog
    ADD CONSTRAINT cat_catalog_sets_entryset_cat_catalog_id_fkey FOREIGN KEY (sets_entryset_cat_catalog_id) REFERENCES public.cat_catalog(cat_catalog_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_catalog_tag cat_catalog_tag_catalog_tag_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_catalog_tag
    ADD CONSTRAINT cat_catalog_tag_catalog_tag_info_fkey FOREIGN KEY (catalog_tag_info) REFERENCES public.cat_catalog_tag_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_catalog_tag_meta_data cat_catalog_tag_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_catalog_tag_meta_data
    ADD CONSTRAINT cat_catalog_tag_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_catalog_tag_meta_data cat_catalog_tag_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_catalog_tag_meta_data
    ADD CONSTRAINT cat_catalog_tag_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_catalog_tag cat_catalog_tag_tags_tag_cat_catalog_cat_catalog_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_catalog_tag
    ADD CONSTRAINT cat_catalog_tag_tags_tag_cat_catalog_cat_catalog_id_fkey FOREIGN KEY (tags_tag_cat_catalog_cat_catalog_id) REFERENCES public.cat_catalog(cat_catalog_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: cat_dcmcatalog cat_dcmcatalog_cat_catalog_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_dcmcatalog
    ADD CONSTRAINT cat_dcmcatalog_cat_catalog_id_fkey FOREIGN KEY (cat_catalog_id) REFERENCES public.cat_catalog(cat_catalog_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: cat_dcmcatalog cat_dcmcatalog_dcmcatalog_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_dcmcatalog
    ADD CONSTRAINT cat_dcmcatalog_dcmcatalog_info_fkey FOREIGN KEY (dcmcatalog_info) REFERENCES public.cat_dcmcatalog_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_dcmcatalog_meta_data cat_dcmcatalog_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_dcmcatalog_meta_data
    ADD CONSTRAINT cat_dcmcatalog_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_dcmcatalog_meta_data cat_dcmcatalog_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_dcmcatalog_meta_data
    ADD CONSTRAINT cat_dcmcatalog_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_dcmentry cat_dcmentry_cat_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_dcmentry
    ADD CONSTRAINT cat_dcmentry_cat_entry_id_fkey FOREIGN KEY (cat_entry_id) REFERENCES public.cat_entry(cat_entry_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: cat_dcmentry cat_dcmentry_dcmentry_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_dcmentry
    ADD CONSTRAINT cat_dcmentry_dcmentry_info_fkey FOREIGN KEY (dcmentry_info) REFERENCES public.cat_dcmentry_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_dcmentry_meta_data cat_dcmentry_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_dcmentry_meta_data
    ADD CONSTRAINT cat_dcmentry_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_dcmentry_meta_data cat_dcmentry_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_dcmentry_meta_data
    ADD CONSTRAINT cat_dcmentry_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_entry cat_entry_entries_entry_cat_catalog_cat_catalog_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_entry
    ADD CONSTRAINT cat_entry_entries_entry_cat_catalog_cat_catalog_id_fkey FOREIGN KEY (entries_entry_cat_catalog_cat_catalog_id) REFERENCES public.cat_catalog(cat_catalog_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: cat_entry cat_entry_entry_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_entry
    ADD CONSTRAINT cat_entry_entry_info_fkey FOREIGN KEY (entry_info) REFERENCES public.cat_entry_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_entry cat_entry_extension_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_entry
    ADD CONSTRAINT cat_entry_extension_fkey FOREIGN KEY (extension) REFERENCES public.xdat_meta_element(xdat_meta_element_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_entry_meta_data cat_entry_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_entry_meta_data
    ADD CONSTRAINT cat_entry_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_entry_meta_data cat_entry_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_entry_meta_data
    ADD CONSTRAINT cat_entry_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_entry_metafield cat_entry_metafield_entry_metafield_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_entry_metafield
    ADD CONSTRAINT cat_entry_metafield_entry_metafield_info_fkey FOREIGN KEY (entry_metafield_info) REFERENCES public.cat_entry_metafield_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_entry_metafield_meta_data cat_entry_metafield_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_entry_metafield_meta_data
    ADD CONSTRAINT cat_entry_metafield_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_entry_metafield_meta_data cat_entry_metafield_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_entry_metafield_meta_data
    ADD CONSTRAINT cat_entry_metafield_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_entry_metafield cat_entry_metafield_metafields_metafield_cat_entry_cat_ent_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_entry_metafield
    ADD CONSTRAINT cat_entry_metafield_metafields_metafield_cat_entry_cat_ent_fkey FOREIGN KEY (metafields_metafield_cat_entry_cat_entry_id) REFERENCES public.cat_entry(cat_entry_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: cat_entry_tag cat_entry_tag_entry_tag_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_entry_tag
    ADD CONSTRAINT cat_entry_tag_entry_tag_info_fkey FOREIGN KEY (entry_tag_info) REFERENCES public.cat_entry_tag_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_entry_tag_meta_data cat_entry_tag_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_entry_tag_meta_data
    ADD CONSTRAINT cat_entry_tag_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_entry_tag_meta_data cat_entry_tag_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_entry_tag_meta_data
    ADD CONSTRAINT cat_entry_tag_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: cat_entry_tag cat_entry_tag_tags_tag_cat_entry_cat_entry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.cat_entry_tag
    ADD CONSTRAINT cat_entry_tag_tags_tag_cat_entry_cat_entry_id_fkey FOREIGN KEY (tags_tag_cat_entry_cat_entry_id) REFERENCES public.cat_entry(cat_entry_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xhbm_subscription fk_1d7cj2ej5wojfiool8ri7gr7k; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_subscription
    ADD CONSTRAINT fk_1d7cj2ej5wojfiool8ri7gr7k FOREIGN KEY (subscriber) REFERENCES public.xhbm_subscriber(id);


--
-- Name: xhbm_xnat_task_info fk_1ukawi9albx2r8t0nbwp7jdut; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_xnat_task_info
    ADD CONSTRAINT fk_1ukawi9albx2r8t0nbwp7jdut FOREIGN KEY (xnat_node_info_id) REFERENCES public.xhbm_xnat_node_info(id);


--
-- Name: xhbm_notification fk_26eshml51jyh4oa6xgghlyqsq; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_notification
    ADD CONSTRAINT fk_26eshml51jyh4oa6xgghlyqsq FOREIGN KEY (definition) REFERENCES public.xhbm_definition(id);


--
-- Name: xhbm_archive_processor_instance_scp_whitelist_aud fk_26tm8fi7evvxkdpbyauwlf6qm; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_archive_processor_instance_scp_whitelist_aud
    ADD CONSTRAINT fk_26tm8fi7evvxkdpbyauwlf6qm FOREIGN KEY (rev) REFERENCES public.xhbm_revinfo(rev);


--
-- Name: xhbm_configuration_data_configurations fk_2s21q9v235oouof1srpoeot68; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_configuration_data_configurations
    ADD CONSTRAINT fk_2s21q9v235oouof1srpoeot68 FOREIGN KEY (configuration_data) REFERENCES public.xhbm_configuration_data(id);


--
-- Name: xhbm_script_trigger_template_triggers fk_34l1x16lm0v81ewo8ut3gr2yq; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_script_trigger_template_triggers
    ADD CONSTRAINT fk_34l1x16lm0v81ewo8ut3gr2yq FOREIGN KEY (script_trigger_template) REFERENCES public.xhbm_script_trigger_template(id);


--
-- Name: xhbm_subscription fk_3ry3ahixumg7786502knoiw9k; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_subscription
    ADD CONSTRAINT fk_3ry3ahixumg7786502knoiw9k FOREIGN KEY (definition) REFERENCES public.xhbm_definition(id);


--
-- Name: xhbm_alias_token_validipaddresses fk_5pu3eg4qx6fs3ri7rklt0gxxx; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_alias_token_validipaddresses
    ADD CONSTRAINT fk_5pu3eg4qx6fs3ri7rklt0gxxx FOREIGN KEY (alias_token) REFERENCES public.xhbm_alias_token(id);


--
-- Name: xhbm_archive_processor_instance_parameters fk_6644clf85mqfu90evmf427hrg; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_archive_processor_instance_parameters
    ADD CONSTRAINT fk_6644clf85mqfu90evmf427hrg FOREIGN KEY (archive_processor_instance) REFERENCES public.xhbm_archive_processor_instance(id);


--
-- Name: xhbm_definition fk_6vv3x9dv0u851p8ouegybplqf; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_definition
    ADD CONSTRAINT fk_6vv3x9dv0u851p8ouegybplqf FOREIGN KEY (category) REFERENCES public.xhbm_category(id);


--
-- Name: xhbm_archive_processor_instance_project_ids_list_aud fk_705w6so1gwnef409xriigapix; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_archive_processor_instance_project_ids_list_aud
    ADD CONSTRAINT fk_705w6so1gwnef409xriigapix FOREIGN KEY (rev) REFERENCES public.xhbm_revinfo(rev);


--
-- Name: xhbm_automation_filters_values fk_8xwk1ulc5b2y9m3q71xqqylo8; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_automation_filters_values
    ADD CONSTRAINT fk_8xwk1ulc5b2y9m3q71xqqylo8 FOREIGN KEY (automation_filters) REFERENCES public.xhbm_automation_filters(id);


--
-- Name: xhbm_preference fk_9qbxn4hvwgos4hojxyf98b1sg; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_preference
    ADD CONSTRAINT fk_9qbxn4hvwgos4hojxyf98b1sg FOREIGN KEY (tool) REFERENCES public.xhbm_tool(id);


--
-- Name: xhbm_archive_processor_instance_scp_whitelist fk_bqhsrcst497irt8v0b36g46yn; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_archive_processor_instance_scp_whitelist
    ADD CONSTRAINT fk_bqhsrcst497irt8v0b36g46yn FOREIGN KEY (archive_processor_instance) REFERENCES public.xhbm_archive_processor_instance(id);


--
-- Name: xhbm_subscription_channels fk_d6f13gwcyqt1ty3mur9yc7tns; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_subscription_channels
    ADD CONSTRAINT fk_d6f13gwcyqt1ty3mur9yc7tns FOREIGN KEY (subscription) REFERENCES public.xhbm_subscription(id);


--
-- Name: xhbm_script_trigger_template_associated_entities fk_dtjm2uxhvmaw1gx2o9nus3lkn; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_script_trigger_template_associated_entities
    ADD CONSTRAINT fk_dtjm2uxhvmaw1gx2o9nus3lkn FOREIGN KEY (script_trigger_template) REFERENCES public.xhbm_script_trigger_template(id);


--
-- Name: xhbm_configuration fk_dudtx26q5dhjm96kgmb4qw89b; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_configuration
    ADD CONSTRAINT fk_dudtx26q5dhjm96kgmb4qw89b FOREIGN KEY (config_data) REFERENCES public.xhbm_configuration_data(id);


--
-- Name: xhbm_event_filters fk_f70g5r1f7r2u7jey079odp0ag; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_event_filters
    ADD CONSTRAINT fk_f70g5r1f7r2u7jey079odp0ag FOREIGN KEY (event_filters) REFERENCES public.xhbm_script_trigger(id);


--
-- Name: xhbm_archive_processor_instance_parameters_aud fk_fbt5b3ywon1mmk6d96uklghet; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_archive_processor_instance_parameters_aud
    ADD CONSTRAINT fk_fbt5b3ywon1mmk6d96uklghet FOREIGN KEY (rev) REFERENCES public.xhbm_revinfo(rev);


--
-- Name: xhbm_archive_processor_instance_scp_blacklist fk_i4gwiqng13n0hmfb82gp5l8qy; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_archive_processor_instance_scp_blacklist
    ADD CONSTRAINT fk_i4gwiqng13n0hmfb82gp5l8qy FOREIGN KEY (archive_processor_instance) REFERENCES public.xhbm_archive_processor_instance(id);


--
-- Name: xhbm_archive_processor_instance_scp_blacklist_aud fk_iulkslbad5sppi97ix33lgu6y; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_archive_processor_instance_scp_blacklist_aud
    ADD CONSTRAINT fk_iulkslbad5sppi97ix33lgu6y FOREIGN KEY (rev) REFERENCES public.xhbm_revinfo(rev);


--
-- Name: xhbm_archive_processor_instance_aud fk_j8kqgmdxdopb0tsg9cm5o8k4c; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_archive_processor_instance_aud
    ADD CONSTRAINT fk_j8kqgmdxdopb0tsg9cm5o8k4c FOREIGN KEY (rev) REFERENCES public.xhbm_revinfo(rev);


--
-- Name: xhbm_archive_processor_instance_project_ids_list fk_k5oftqmt6se98t45kg0tcwd6a; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_archive_processor_instance_project_ids_list
    ADD CONSTRAINT fk_k5oftqmt6se98t45kg0tcwd6a FOREIGN KEY (archive_processor_instance) REFERENCES public.xhbm_archive_processor_instance(id);


--
-- Name: xhbm_event_specific_fields fk_kysxams0olmh2r188if8oluy9; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_event_specific_fields
    ADD CONSTRAINT fk_kysxams0olmh2r188if8oluy9 FOREIGN KEY (event_specific_fields) REFERENCES public.xhbm_persistent_event(id);


--
-- Name: xhbm_configuration_data_configurations fk_mdcxpup676rj7pi4lp8w44msb; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_configuration_data_configurations
    ADD CONSTRAINT fk_mdcxpup676rj7pi4lp8w44msb FOREIGN KEY (configurations) REFERENCES public.xhbm_configuration(id);


--
-- Name: xhbm_script_aud fk_nmrv8k3euwstmqtcg0lir048r; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_script_aud
    ADD CONSTRAINT fk_nmrv8k3euwstmqtcg0lir048r FOREIGN KEY (rev) REFERENCES public.xhbm_revinfo(rev);


--
-- Name: xhbm_automation_event_ids_ids fk_nng19e6dofdf9y2itx7we356j; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_automation_event_ids_ids
    ADD CONSTRAINT fk_nng19e6dofdf9y2itx7we356j FOREIGN KEY (parent_automation_event_ids) REFERENCES public.xhbm_automation_event_ids(id);


--
-- Name: xhbm_subscription_channels fk_qbrhqvty2babxxwe2bp2u7cs4; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_subscription_channels
    ADD CONSTRAINT fk_qbrhqvty2babxxwe2bp2u7cs4 FOREIGN KEY (channels) REFERENCES public.xhbm_channel(id);


--
-- Name: xhbm_event_filters_filter_vals fk_sf2jajrr1itnxfc53u3h7o8vd; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_event_filters_filter_vals
    ADD CONSTRAINT fk_sf2jajrr1itnxfc53u3h7o8vd FOREIGN KEY (event_filters) REFERENCES public.xhbm_event_filters(id);


--
-- Name: xhbm_script_trigger_template_triggers fk_tlyrp4h0ka768uciajoipg60c; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_script_trigger_template_triggers
    ADD CONSTRAINT fk_tlyrp4h0ka768uciajoipg60c FOREIGN KEY (triggers) REFERENCES public.xhbm_script_trigger(id);


--
-- Name: xhbm_script_launch_request_event fk_tnlm0wwdoi64c1tuelph0jdju; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xhbm_script_launch_request_event
    ADD CONSTRAINT fk_tnlm0wwdoi64c1tuelph0jdju FOREIGN KEY (id) REFERENCES public.xhbm_persistent_event(id);


--
-- Name: img_assessor_in_resource img_assessor_in_resource_xnat_abstractresource_xnat_abstra_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.img_assessor_in_resource
    ADD CONSTRAINT img_assessor_in_resource_xnat_abstractresource_xnat_abstra_fkey FOREIGN KEY (xnat_abstractresource_xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: img_assessor_in_resource img_assessor_in_resource_xnat_imageassessordata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.img_assessor_in_resource
    ADD CONSTRAINT img_assessor_in_resource_xnat_imageassessordata_id_fkey FOREIGN KEY (xnat_imageassessordata_id) REFERENCES public.xnat_imageassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: img_assessor_out_resource img_assessor_out_resource_xnat_abstractresource_xnat_abstr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.img_assessor_out_resource
    ADD CONSTRAINT img_assessor_out_resource_xnat_abstractresource_xnat_abstr_fkey FOREIGN KEY (xnat_abstractresource_xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: img_assessor_out_resource img_assessor_out_resource_xnat_imageassessordata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.img_assessor_out_resource
    ADD CONSTRAINT img_assessor_out_resource_xnat_imageassessordata_id_fkey FOREIGN KEY (xnat_imageassessordata_id) REFERENCES public.xnat_imageassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: pipe_pipelinedetails_element_meta_data pipe_pipelinedetails_element__activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinedetails_element_meta_data
    ADD CONSTRAINT pipe_pipelinedetails_element__activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: pipe_pipelinedetails_element pipe_pipelinedetails_element_generateselements_element_pip_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinedetails_element
    ADD CONSTRAINT pipe_pipelinedetails_element_generateselements_element_pip_fkey FOREIGN KEY (generateselements_element_pipe__path) REFERENCES public.pipe_pipelinedetails(path) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: pipe_pipelinedetails_element_meta_data pipe_pipelinedetails_element_meta_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinedetails_element_meta_data
    ADD CONSTRAINT pipe_pipelinedetails_element_meta_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: pipe_pipelinedetails_element pipe_pipelinedetails_element_pipelinedetails_element_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinedetails_element
    ADD CONSTRAINT pipe_pipelinedetails_element_pipelinedetails_element_info_fkey FOREIGN KEY (pipelinedetails_element_info) REFERENCES public.pipe_pipelinedetails_element_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: pipe_pipelinedetails_meta_data pipe_pipelinedetails_meta_dat_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinedetails_meta_data
    ADD CONSTRAINT pipe_pipelinedetails_meta_dat_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: pipe_pipelinedetails_meta_data pipe_pipelinedetails_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinedetails_meta_data
    ADD CONSTRAINT pipe_pipelinedetails_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: pipe_pipelinedetails_parameter_meta_data pipe_pipelinedetails_paramete_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinedetails_parameter_meta_data
    ADD CONSTRAINT pipe_pipelinedetails_paramete_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: pipe_pipelinedetails_parameter pipe_pipelinedetails_paramete_parameters_parameter_pipe_pi_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinedetails_parameter
    ADD CONSTRAINT pipe_pipelinedetails_paramete_parameters_parameter_pipe_pi_fkey FOREIGN KEY (parameters_parameter_pipe_pipel_path) REFERENCES public.pipe_pipelinedetails(path) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: pipe_pipelinedetails_parameter pipe_pipelinedetails_paramete_pipelinedetails_parameter_in_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinedetails_parameter
    ADD CONSTRAINT pipe_pipelinedetails_paramete_pipelinedetails_parameter_in_fkey FOREIGN KEY (pipelinedetails_parameter_info) REFERENCES public.pipe_pipelinedetails_parameter_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: pipe_pipelinedetails_parameter_meta_data pipe_pipelinedetails_parameter_me_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinedetails_parameter_meta_data
    ADD CONSTRAINT pipe_pipelinedetails_parameter_me_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: pipe_pipelinedetails pipe_pipelinedetails_pipe_pipelinerepository_pipe_pipeline_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinedetails
    ADD CONSTRAINT pipe_pipelinedetails_pipe_pipelinerepository_pipe_pipeline_fkey FOREIGN KEY (pipe_pipelinerepository_pipe_pipelinerepository_id) REFERENCES public.pipe_pipelinerepository(pipe_pipelinerepository_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: pipe_pipelinedetails pipe_pipelinedetails_pipelinedetails_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinedetails
    ADD CONSTRAINT pipe_pipelinedetails_pipelinedetails_info_fkey FOREIGN KEY (pipelinedetails_info) REFERENCES public.pipe_pipelinedetails_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: pipe_pipelinerepository_meta_data pipe_pipelinerepository_meta__activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinerepository_meta_data
    ADD CONSTRAINT pipe_pipelinerepository_meta__activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: pipe_pipelinerepository_meta_data pipe_pipelinerepository_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinerepository_meta_data
    ADD CONSTRAINT pipe_pipelinerepository_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: pipe_pipelinerepository pipe_pipelinerepository_pipelinerepository_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.pipe_pipelinerepository
    ADD CONSTRAINT pipe_pipelinerepository_pipelinerepository_info_fkey FOREIGN KEY (pipelinerepository_info) REFERENCES public.pipe_pipelinerepository_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: prov_process_meta_data prov_process_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.prov_process_meta_data
    ADD CONSTRAINT prov_process_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: prov_process_meta_data prov_process_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.prov_process_meta_data
    ADD CONSTRAINT prov_process_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: prov_process prov_process_process_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.prov_process
    ADD CONSTRAINT prov_process_process_info_fkey FOREIGN KEY (process_info) REFERENCES public.prov_process_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: prov_processstep_library_meta_data prov_processstep_library_meta_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.prov_processstep_library_meta_data
    ADD CONSTRAINT prov_processstep_library_meta_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: prov_processstep_library_meta_data prov_processstep_library_meta_dat_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.prov_processstep_library_meta_data
    ADD CONSTRAINT prov_processstep_library_meta_dat_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: prov_processstep_library prov_processstep_library_processstep_library_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.prov_processstep_library
    ADD CONSTRAINT prov_processstep_library_processstep_library_info_fkey FOREIGN KEY (processstep_library_info) REFERENCES public.prov_processstep_library_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: prov_processstep_library prov_processstep_library_prov_processstep_prov_processstep_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.prov_processstep_library
    ADD CONSTRAINT prov_processstep_library_prov_processstep_prov_processstep_fkey FOREIGN KEY (prov_processstep_prov_processstep_id) REFERENCES public.prov_processstep(prov_processstep_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: prov_processstep_meta_data prov_processstep_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.prov_processstep_meta_data
    ADD CONSTRAINT prov_processstep_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: prov_processstep_meta_data prov_processstep_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.prov_processstep_meta_data
    ADD CONSTRAINT prov_processstep_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: prov_processstep prov_processstep_processstep_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.prov_processstep
    ADD CONSTRAINT prov_processstep_processstep_info_fkey FOREIGN KEY (processstep_info) REFERENCES public.prov_processstep_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: prov_processstep prov_processstep_prov_process_prov_process_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.prov_processstep
    ADD CONSTRAINT prov_processstep_prov_process_prov_process_id_fkey FOREIGN KEY (prov_process_prov_process_id) REFERENCES public.prov_process(prov_process_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: recon_in_resource recon_in_resource_xnat_abstractresource_xnat_abstractresou_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.recon_in_resource
    ADD CONSTRAINT recon_in_resource_xnat_abstractresource_xnat_abstractresou_fkey FOREIGN KEY (xnat_abstractresource_xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: recon_in_resource recon_in_resource_xnat_reconstructedimagedata_xnat_reconst_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.recon_in_resource
    ADD CONSTRAINT recon_in_resource_xnat_reconstructedimagedata_xnat_reconst_fkey FOREIGN KEY (xnat_reconstructedimagedata_xnat_reconstructedimagedata_id) REFERENCES public.xnat_reconstructedimagedata(xnat_reconstructedimagedata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: recon_out_resource recon_out_resource_xnat_abstractresource_xnat_abstractreso_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.recon_out_resource
    ADD CONSTRAINT recon_out_resource_xnat_abstractresource_xnat_abstractreso_fkey FOREIGN KEY (xnat_abstractresource_xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: recon_out_resource recon_out_resource_xnat_reconstructedimagedata_xnat_recons_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.recon_out_resource
    ADD CONSTRAINT recon_out_resource_xnat_reconstructedimagedata_xnat_recons_fkey FOREIGN KEY (xnat_reconstructedimagedata_xnat_reconstructedimagedata_id) REFERENCES public.xnat_reconstructedimagedata(xnat_reconstructedimagedata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: scr_screeningassessment scr_screeningassessment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.scr_screeningassessment
    ADD CONSTRAINT scr_screeningassessment_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imageassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: scr_screeningassessment_meta_data scr_screeningassessment_meta__activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.scr_screeningassessment_meta_data
    ADD CONSTRAINT scr_screeningassessment_meta__activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: scr_screeningassessment_meta_data scr_screeningassessment_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.scr_screeningassessment_meta_data
    ADD CONSTRAINT scr_screeningassessment_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: scr_screeningassessment scr_screeningassessment_screeningassessment_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.scr_screeningassessment
    ADD CONSTRAINT scr_screeningassessment_screeningassessment_info_fkey FOREIGN KEY (screeningassessment_info) REFERENCES public.scr_screeningassessment_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: scr_screeningscandata_meta_data scr_screeningscandata_meta_da_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.scr_screeningscandata_meta_data
    ADD CONSTRAINT scr_screeningscandata_meta_da_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: scr_screeningscandata_meta_data scr_screeningscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.scr_screeningscandata_meta_data
    ADD CONSTRAINT scr_screeningscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: scr_screeningscandata scr_screeningscandata_scans_scan_scr_screeningassessm_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.scr_screeningscandata
    ADD CONSTRAINT scr_screeningscandata_scans_scan_scr_screeningassessm_id_fkey FOREIGN KEY (scans_scan_scr_screeningassessm_id) REFERENCES public.scr_screeningassessment(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: scr_screeningscandata scr_screeningscandata_screeningscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.scr_screeningscandata
    ADD CONSTRAINT scr_screeningscandata_screeningscandata_info_fkey FOREIGN KEY (screeningscandata_info) REFERENCES public.scr_screeningscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_additionalval val_additionalval_additionalval_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_additionalval
    ADD CONSTRAINT val_additionalval_additionalval_info_fkey FOREIGN KEY (additionalval_info) REFERENCES public.val_additionalval_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_additionalval_meta_data val_additionalval_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_additionalval_meta_data
    ADD CONSTRAINT val_additionalval_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_additionalval_meta_data val_additionalval_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_additionalval_meta_data
    ADD CONSTRAINT val_additionalval_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata val_protocoldata_check_additionalval_val_additionalval_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata
    ADD CONSTRAINT val_protocoldata_check_additionalval_val_additionalval_id_fkey FOREIGN KEY (check_additionalval_val_additionalval_id) REFERENCES public.val_additionalval(val_additionalval_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_comment val_protocoldata_comment_check_comments_comment_val_prot_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_comment
    ADD CONSTRAINT val_protocoldata_comment_check_comments_comment_val_prot_i_fkey FOREIGN KEY (check_comments_comment_val_prot_id) REFERENCES public.val_protocoldata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: val_protocoldata_comment_meta_data val_protocoldata_comment_meta_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_comment_meta_data
    ADD CONSTRAINT val_protocoldata_comment_meta_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_comment_meta_data val_protocoldata_comment_meta_dat_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_comment_meta_data
    ADD CONSTRAINT val_protocoldata_comment_meta_dat_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_comment val_protocoldata_comment_protocoldata_comment_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_comment
    ADD CONSTRAINT val_protocoldata_comment_protocoldata_comment_info_fkey FOREIGN KEY (protocoldata_comment_info) REFERENCES public.val_protocoldata_comment_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_condition val_protocoldata_condition_check_conditions_condition_val__fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_condition
    ADD CONSTRAINT val_protocoldata_condition_check_conditions_condition_val__fkey FOREIGN KEY (check_conditions_condition_val__id) REFERENCES public.val_protocoldata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: val_protocoldata_condition_meta_data val_protocoldata_condition_me_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_condition_meta_data
    ADD CONSTRAINT val_protocoldata_condition_me_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_condition_meta_data val_protocoldata_condition_meta_d_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_condition_meta_data
    ADD CONSTRAINT val_protocoldata_condition_meta_d_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_condition val_protocoldata_condition_protocoldata_condition_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_condition
    ADD CONSTRAINT val_protocoldata_condition_protocoldata_condition_info_fkey FOREIGN KEY (protocoldata_condition_info) REFERENCES public.val_protocoldata_condition_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata val_protocoldata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata
    ADD CONSTRAINT val_protocoldata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imageassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: val_protocoldata_meta_data val_protocoldata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_meta_data
    ADD CONSTRAINT val_protocoldata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_meta_data val_protocoldata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_meta_data
    ADD CONSTRAINT val_protocoldata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata val_protocoldata_protocoldata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata
    ADD CONSTRAINT val_protocoldata_protocoldata_info_fkey FOREIGN KEY (protocoldata_info) REFERENCES public.val_protocoldata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_scan_check_condition_meta_data val_protocoldata_scan_check__activation_user_xdat_user_id_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_scan_check_condition_meta_data
    ADD CONSTRAINT val_protocoldata_scan_check__activation_user_xdat_user_id_fkey1 FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_scan_check val_protocoldata_scan_check_additionalval_val_additionalva_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_scan_check
    ADD CONSTRAINT val_protocoldata_scan_check_additionalval_val_additionalva_fkey FOREIGN KEY (additionalval_val_additionalval_id) REFERENCES public.val_additionalval(val_additionalval_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_scan_check_comment_meta_data val_protocoldata_scan_check_c_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_scan_check_comment_meta_data
    ADD CONSTRAINT val_protocoldata_scan_check_c_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_scan_check_comment val_protocoldata_scan_check_c_comments_comment_val_protoco_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_scan_check_comment
    ADD CONSTRAINT val_protocoldata_scan_check_c_comments_comment_val_protoco_fkey FOREIGN KEY (comments_comment_val_protocolda_val_protocoldata_scan_check_id) REFERENCES public.val_protocoldata_scan_check(val_protocoldata_scan_check_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: val_protocoldata_scan_check_condition val_protocoldata_scan_check_c_conditions_condition_val_pro_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_scan_check_condition
    ADD CONSTRAINT val_protocoldata_scan_check_c_conditions_condition_val_pro_fkey FOREIGN KEY (conditions_condition_val_protoc_val_protocoldata_scan_check_id) REFERENCES public.val_protocoldata_scan_check(val_protocoldata_scan_check_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: val_protocoldata_scan_check_comment val_protocoldata_scan_check_c_protocoldata_scan_check_comm_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_scan_check_comment
    ADD CONSTRAINT val_protocoldata_scan_check_c_protocoldata_scan_check_comm_fkey FOREIGN KEY (protocoldata_scan_check_comment_info) REFERENCES public.val_protocoldata_scan_check_comment_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_scan_check_condition val_protocoldata_scan_check_c_protocoldata_scan_check_cond_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_scan_check_condition
    ADD CONSTRAINT val_protocoldata_scan_check_c_protocoldata_scan_check_cond_fkey FOREIGN KEY (protocoldata_scan_check_condition_info) REFERENCES public.val_protocoldata_scan_check_condition_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_scan_check_comment_meta_data val_protocoldata_scan_check_comme_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_scan_check_comment_meta_data
    ADD CONSTRAINT val_protocoldata_scan_check_comme_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_scan_check_condition_meta_data val_protocoldata_scan_check_condi_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_scan_check_condition_meta_data
    ADD CONSTRAINT val_protocoldata_scan_check_condi_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_scan_check_meta_data val_protocoldata_scan_check_m_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_scan_check_meta_data
    ADD CONSTRAINT val_protocoldata_scan_check_m_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_scan_check_meta_data val_protocoldata_scan_check_meta__insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_scan_check_meta_data
    ADD CONSTRAINT val_protocoldata_scan_check_meta__insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_scan_check val_protocoldata_scan_check_protocoldata_scan_check_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_scan_check
    ADD CONSTRAINT val_protocoldata_scan_check_protocoldata_scan_check_info_fkey FOREIGN KEY (protocoldata_scan_check_info) REFERENCES public.val_protocoldata_scan_check_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: val_protocoldata_scan_check val_protocoldata_scan_check_scans_scan_check_val_protocold_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.val_protocoldata_scan_check
    ADD CONSTRAINT val_protocoldata_scan_check_scans_scan_check_val_protocold_fkey FOREIGN KEY (scans_scan_check_val_protocolda_id) REFERENCES public.val_protocoldata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: wrk_abstractexecutionenvironment wrk_abstractexecutionenvironm_abstractexecutionenvironment_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_abstractexecutionenvironment
    ADD CONSTRAINT wrk_abstractexecutionenvironm_abstractexecutionenvironment_fkey FOREIGN KEY (abstractexecutionenvironment_info) REFERENCES public.wrk_abstractexecutionenvironment_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_abstractexecutionenvironment_meta_data wrk_abstractexecutionenvironm_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_abstractexecutionenvironment_meta_data
    ADD CONSTRAINT wrk_abstractexecutionenvironm_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_abstractexecutionenvironment_meta_data wrk_abstractexecutionenvironment__insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_abstractexecutionenvironment_meta_data
    ADD CONSTRAINT wrk_abstractexecutionenvironment__insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_abstractexecutionenvironment wrk_abstractexecutionenvironment_extension_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_abstractexecutionenvironment
    ADD CONSTRAINT wrk_abstractexecutionenvironment_extension_fkey FOREIGN KEY (extension) REFERENCES public.xdat_meta_element(xdat_meta_element_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_workflowdata wrk_workflowdata_executionenvironment_wrk_abstractexecutio_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_workflowdata
    ADD CONSTRAINT wrk_workflowdata_executionenvironment_wrk_abstractexecutio_fkey FOREIGN KEY (executionenvironment_wrk_abstractexecutionenvironment_id) REFERENCES public.wrk_abstractexecutionenvironment(wrk_abstractexecutionenvironment_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_workflowdata_meta_data wrk_workflowdata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_workflowdata_meta_data
    ADD CONSTRAINT wrk_workflowdata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_workflowdata_meta_data wrk_workflowdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_workflowdata_meta_data
    ADD CONSTRAINT wrk_workflowdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_workflowdata wrk_workflowdata_workflowdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_workflowdata
    ADD CONSTRAINT wrk_workflowdata_workflowdata_info_fkey FOREIGN KEY (workflowdata_info) REFERENCES public.wrk_workflowdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_xnatexecutionenvironment_notify_meta_data wrk_xnatexecutionenvironment__activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_xnatexecutionenvironment_notify_meta_data
    ADD CONSTRAINT wrk_xnatexecutionenvironment__activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_xnatexecutionenvironment_parameter wrk_xnatexecutionenvironment__parameters_parameter_wrk_xna_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_xnatexecutionenvironment_parameter
    ADD CONSTRAINT wrk_xnatexecutionenvironment__parameters_parameter_wrk_xna_fkey FOREIGN KEY (parameters_parameter_wrk_xnatex_wrk_abstractexecutionenvironmen) REFERENCES public.wrk_xnatexecutionenvironment(wrk_abstractexecutionenvironment_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: wrk_xnatexecutionenvironment_notify wrk_xnatexecutionenvironment__wrk_xnatexecutionenvironment_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_xnatexecutionenvironment_notify
    ADD CONSTRAINT wrk_xnatexecutionenvironment__wrk_xnatexecutionenvironment_fkey FOREIGN KEY (wrk_xnatexecutionenvironment_wrk_abstractexecutionenvironmen) REFERENCES public.wrk_xnatexecutionenvironment(wrk_abstractexecutionenvironment_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: wrk_xnatexecutionenvironment_notify wrk_xnatexecutionenvironment__xnatexecutionenvironment_not_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_xnatexecutionenvironment_notify
    ADD CONSTRAINT wrk_xnatexecutionenvironment__xnatexecutionenvironment_not_fkey FOREIGN KEY (xnatexecutionenvironment_notify_info) REFERENCES public.wrk_xnatexecutionenvironment_notify_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_xnatexecutionenvironment_parameter wrk_xnatexecutionenvironment__xnatexecutionenvironment_par_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_xnatexecutionenvironment_parameter
    ADD CONSTRAINT wrk_xnatexecutionenvironment__xnatexecutionenvironment_par_fkey FOREIGN KEY (xnatexecutionenvironment_parameter_info) REFERENCES public.wrk_xnatexecutionenvironment_parameter_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_xnatexecutionenvironment_parameter_meta_data wrk_xnatexecutionenvironment_activation_user_xdat_user_id_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_xnatexecutionenvironment_parameter_meta_data
    ADD CONSTRAINT wrk_xnatexecutionenvironment_activation_user_xdat_user_id_fkey1 FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_xnatexecutionenvironment_meta_data wrk_xnatexecutionenvironment_activation_user_xdat_user_id_fkey2; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_xnatexecutionenvironment_meta_data
    ADD CONSTRAINT wrk_xnatexecutionenvironment_activation_user_xdat_user_id_fkey2 FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_xnatexecutionenvironment_meta_data wrk_xnatexecutionenvironment_meta_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_xnatexecutionenvironment_meta_data
    ADD CONSTRAINT wrk_xnatexecutionenvironment_meta_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_xnatexecutionenvironment_notify_meta_data wrk_xnatexecutionenvironment_noti_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_xnatexecutionenvironment_notify_meta_data
    ADD CONSTRAINT wrk_xnatexecutionenvironment_noti_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_xnatexecutionenvironment_parameter_meta_data wrk_xnatexecutionenvironment_para_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_xnatexecutionenvironment_parameter_meta_data
    ADD CONSTRAINT wrk_xnatexecutionenvironment_para_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: wrk_xnatexecutionenvironment wrk_xnatexecutionenvironment_wrk_abstractexecutionenvironm_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_xnatexecutionenvironment
    ADD CONSTRAINT wrk_xnatexecutionenvironment_wrk_abstractexecutionenvironm_fkey FOREIGN KEY (wrk_abstractexecutionenvironment_id) REFERENCES public.wrk_abstractexecutionenvironment(wrk_abstractexecutionenvironment_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: wrk_xnatexecutionenvironment wrk_xnatexecutionenvironment_xnatexecutionenvironment_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.wrk_xnatexecutionenvironment
    ADD CONSTRAINT wrk_xnatexecutionenvironment_xnatexecutionenvironment_info_fkey FOREIGN KEY (xnatexecutionenvironment_info) REFERENCES public.wrk_xnatexecutionenvironment_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_a_xdat_action_type_allowe_xdat_role_type xdat_a_xdat_action_type_allow_xdat_action_type_action_name_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_a_xdat_action_type_allowe_xdat_role_type
    ADD CONSTRAINT xdat_a_xdat_action_type_allow_xdat_action_type_action_name_fkey FOREIGN KEY (xdat_action_type_action_name) REFERENCES public.xdat_action_type(action_name) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_a_xdat_action_type_allowe_xdat_role_type xdat_a_xdat_action_type_allowe_xd_xdat_role_type_role_name_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_a_xdat_action_type_allowe_xdat_role_type
    ADD CONSTRAINT xdat_a_xdat_action_type_allowe_xd_xdat_role_type_role_name_fkey FOREIGN KEY (xdat_role_type_role_name) REFERENCES public.xdat_role_type(role_name) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_access_log xdat_access_log_access_log_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_access_log
    ADD CONSTRAINT xdat_access_log_access_log_info_fkey FOREIGN KEY (access_log_info) REFERENCES public.xdat_access_log_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_access_log_meta_data xdat_access_log_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_access_log_meta_data
    ADD CONSTRAINT xdat_access_log_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_access_log_meta_data xdat_access_log_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_access_log_meta_data
    ADD CONSTRAINT xdat_access_log_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_action_type xdat_action_type_action_type_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_action_type
    ADD CONSTRAINT xdat_action_type_action_type_info_fkey FOREIGN KEY (action_type_info) REFERENCES public.xdat_action_type_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_action_type xdat_action_type_actions_action_xdat_security_xdat_securit_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_action_type
    ADD CONSTRAINT xdat_action_type_actions_action_xdat_security_xdat_securit_fkey FOREIGN KEY (actions_action_xdat_security_xdat_security_id) REFERENCES public.xdat_security(xdat_security_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_action_type_meta_data xdat_action_type_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_action_type_meta_data
    ADD CONSTRAINT xdat_action_type_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_action_type_meta_data xdat_action_type_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_action_type_meta_data
    ADD CONSTRAINT xdat_action_type_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_change_info xdat_change_info_change_info_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_change_info
    ADD CONSTRAINT xdat_change_info_change_info_info_fkey FOREIGN KEY (change_info_info) REFERENCES public.xdat_change_info_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_change_info xdat_change_info_change_user_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_change_info
    ADD CONSTRAINT xdat_change_info_change_user_fkey FOREIGN KEY (change_user) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_change_info_meta_data xdat_change_info_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_change_info_meta_data
    ADD CONSTRAINT xdat_change_info_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_change_info_meta_data xdat_change_info_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_change_info_meta_data
    ADD CONSTRAINT xdat_change_info_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_criteria xdat_criteria_criteria_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_criteria
    ADD CONSTRAINT xdat_criteria_criteria_info_fkey FOREIGN KEY (criteria_info) REFERENCES public.xdat_criteria_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_criteria_meta_data xdat_criteria_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_criteria_meta_data
    ADD CONSTRAINT xdat_criteria_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_criteria_meta_data xdat_criteria_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_criteria_meta_data
    ADD CONSTRAINT xdat_criteria_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_criteria_set xdat_criteria_set_child_set_xdat_criteria_set_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_criteria_set
    ADD CONSTRAINT xdat_criteria_set_child_set_xdat_criteria_set_id_fkey FOREIGN KEY (child_set_xdat_criteria_set_id) REFERENCES public.xdat_criteria_set(xdat_criteria_set_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_criteria_set xdat_criteria_set_criteria_set_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_criteria_set
    ADD CONSTRAINT xdat_criteria_set_criteria_set_info_fkey FOREIGN KEY (criteria_set_info) REFERENCES public.xdat_criteria_set_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_criteria_set_meta_data xdat_criteria_set_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_criteria_set_meta_data
    ADD CONSTRAINT xdat_criteria_set_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_criteria_set_meta_data xdat_criteria_set_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_criteria_set_meta_data
    ADD CONSTRAINT xdat_criteria_set_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_criteria_set xdat_criteria_set_xdat_stored_search_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_criteria_set
    ADD CONSTRAINT xdat_criteria_set_xdat_stored_search_id_fkey FOREIGN KEY (xdat_stored_search_id) REFERENCES public.xdat_stored_search(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_criteria xdat_criteria_xdat_criteria_set_xdat_criteria_set_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_criteria
    ADD CONSTRAINT xdat_criteria_xdat_criteria_set_xdat_criteria_set_id_fkey FOREIGN KEY (xdat_criteria_set_xdat_criteria_set_id) REFERENCES public.xdat_criteria_set(xdat_criteria_set_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_element_access xdat_element_access_element_access_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_access
    ADD CONSTRAINT xdat_element_access_element_access_info_fkey FOREIGN KEY (element_access_info) REFERENCES public.xdat_element_access_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_access_meta_data xdat_element_access_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_access_meta_data
    ADD CONSTRAINT xdat_element_access_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_access_meta_data xdat_element_access_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_access_meta_data
    ADD CONSTRAINT xdat_element_access_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_access_secure_ip_meta_data xdat_element_access_secure_ip_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_access_secure_ip_meta_data
    ADD CONSTRAINT xdat_element_access_secure_ip_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_access_secure_ip xdat_element_access_secure_ip_element_access_secure_ip_inf_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_access_secure_ip
    ADD CONSTRAINT xdat_element_access_secure_ip_element_access_secure_ip_inf_fkey FOREIGN KEY (element_access_secure_ip_info) REFERENCES public.xdat_element_access_secure_ip_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_access_secure_ip_meta_data xdat_element_access_secure_ip_met_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_access_secure_ip_meta_data
    ADD CONSTRAINT xdat_element_access_secure_ip_met_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_access_secure_ip xdat_element_access_secure_ip_xdat_element_access_xdat_ele_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_access_secure_ip
    ADD CONSTRAINT xdat_element_access_secure_ip_xdat_element_access_xdat_ele_fkey FOREIGN KEY (xdat_element_access_xdat_element_access_id) REFERENCES public.xdat_element_access(xdat_element_access_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_element_access xdat_element_access_xdat_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_access
    ADD CONSTRAINT xdat_element_access_xdat_user_xdat_user_id_fkey FOREIGN KEY (xdat_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_element_access xdat_element_access_xdat_usergroup_xdat_usergroup_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_access
    ADD CONSTRAINT xdat_element_access_xdat_usergroup_xdat_usergroup_id_fkey FOREIGN KEY (xdat_usergroup_xdat_usergroup_id) REFERENCES public.xdat_usergroup(xdat_usergroup_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_element_action_type xdat_element_action_type_element_action_type_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_action_type
    ADD CONSTRAINT xdat_element_action_type_element_action_type_info_fkey FOREIGN KEY (element_action_type_info) REFERENCES public.xdat_element_action_type_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_action_type xdat_element_action_type_element_actions_element_action__e_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_action_type
    ADD CONSTRAINT xdat_element_action_type_element_actions_element_action__e_fkey FOREIGN KEY (element_actions_element_action__element_name) REFERENCES public.xdat_element_security(element_name) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_element_action_type_meta_data xdat_element_action_type_meta_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_action_type_meta_data
    ADD CONSTRAINT xdat_element_action_type_meta_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_action_type_meta_data xdat_element_action_type_meta_dat_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_action_type_meta_data
    ADD CONSTRAINT xdat_element_action_type_meta_dat_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_security xdat_element_security_element_security_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_security
    ADD CONSTRAINT xdat_element_security_element_security_info_fkey FOREIGN KEY (element_security_info) REFERENCES public.xdat_element_security_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_security xdat_element_security_element_security_set_element_se_xdat_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_security
    ADD CONSTRAINT xdat_element_security_element_security_set_element_se_xdat_fkey FOREIGN KEY (element_security_set_element_se_xdat_security_id) REFERENCES public.xdat_security(xdat_security_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_element_security_listing_action_meta_data xdat_element_security_listing_act_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_security_listing_action_meta_data
    ADD CONSTRAINT xdat_element_security_listing_act_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_security_listing_action_meta_data xdat_element_security_listing_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_security_listing_action_meta_data
    ADD CONSTRAINT xdat_element_security_listing_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_security_listing_action xdat_element_security_listing_element_security_listing_act_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_security_listing_action
    ADD CONSTRAINT xdat_element_security_listing_element_security_listing_act_fkey FOREIGN KEY (element_security_listing_action_info) REFERENCES public.xdat_element_security_listing_action_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_security_listing_action xdat_element_security_listing_listing_actions_listing_acti_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_security_listing_action
    ADD CONSTRAINT xdat_element_security_listing_listing_actions_listing_acti_fkey FOREIGN KEY (listing_actions_listing_action__element_name) REFERENCES public.xdat_element_security(element_name) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_element_security_meta_data xdat_element_security_meta_da_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_security_meta_data
    ADD CONSTRAINT xdat_element_security_meta_da_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_element_security_meta_data xdat_element_security_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_element_security_meta_data
    ADD CONSTRAINT xdat_element_security_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_field_mapping xdat_field_mapping_field_mapping_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_field_mapping
    ADD CONSTRAINT xdat_field_mapping_field_mapping_info_fkey FOREIGN KEY (field_mapping_info) REFERENCES public.xdat_field_mapping_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_field_mapping_meta_data xdat_field_mapping_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_field_mapping_meta_data
    ADD CONSTRAINT xdat_field_mapping_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_field_mapping_meta_data xdat_field_mapping_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_field_mapping_meta_data
    ADD CONSTRAINT xdat_field_mapping_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_field_mapping_set xdat_field_mapping_set_field_mapping_set_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_field_mapping_set
    ADD CONSTRAINT xdat_field_mapping_set_field_mapping_set_info_fkey FOREIGN KEY (field_mapping_set_info) REFERENCES public.xdat_field_mapping_set_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_field_mapping_set_meta_data xdat_field_mapping_set_meta_d_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_field_mapping_set_meta_data
    ADD CONSTRAINT xdat_field_mapping_set_meta_d_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_field_mapping_set_meta_data xdat_field_mapping_set_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_field_mapping_set_meta_data
    ADD CONSTRAINT xdat_field_mapping_set_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_field_mapping_set xdat_field_mapping_set_permissions_allow_set_xdat_elem_xda_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_field_mapping_set
    ADD CONSTRAINT xdat_field_mapping_set_permissions_allow_set_xdat_elem_xda_fkey FOREIGN KEY (permissions_allow_set_xdat_elem_xdat_element_access_id) REFERENCES public.xdat_element_access(xdat_element_access_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_field_mapping_set xdat_field_mapping_set_sub_set_xdat_field_mapping_set_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_field_mapping_set
    ADD CONSTRAINT xdat_field_mapping_set_sub_set_xdat_field_mapping_set_id_fkey FOREIGN KEY (sub_set_xdat_field_mapping_set_id) REFERENCES public.xdat_field_mapping_set(xdat_field_mapping_set_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_field_mapping xdat_field_mapping_xdat_field_mapping_set_xdat_field_mappi_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_field_mapping
    ADD CONSTRAINT xdat_field_mapping_xdat_field_mapping_set_xdat_field_mappi_fkey FOREIGN KEY (xdat_field_mapping_set_xdat_field_mapping_set_id) REFERENCES public.xdat_field_mapping_set(xdat_field_mapping_set_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_infoentry xdat_infoentry_infoentry_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_infoentry
    ADD CONSTRAINT xdat_infoentry_infoentry_info_fkey FOREIGN KEY (infoentry_info) REFERENCES public.xdat_infoentry_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_infoentry_meta_data xdat_infoentry_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_infoentry_meta_data
    ADD CONSTRAINT xdat_infoentry_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_infoentry_meta_data xdat_infoentry_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_infoentry_meta_data
    ADD CONSTRAINT xdat_infoentry_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_newsentry_meta_data xdat_newsentry_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_newsentry_meta_data
    ADD CONSTRAINT xdat_newsentry_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_newsentry_meta_data xdat_newsentry_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_newsentry_meta_data
    ADD CONSTRAINT xdat_newsentry_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_newsentry xdat_newsentry_newsentry_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_newsentry
    ADD CONSTRAINT xdat_newsentry_newsentry_info_fkey FOREIGN KEY (newsentry_info) REFERENCES public.xdat_newsentry_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_primary_security_field_meta_data xdat_primary_security_field_m_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_primary_security_field_meta_data
    ADD CONSTRAINT xdat_primary_security_field_m_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_primary_security_field_meta_data xdat_primary_security_field_meta__insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_primary_security_field_meta_data
    ADD CONSTRAINT xdat_primary_security_field_meta__insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_primary_security_field xdat_primary_security_field_primary_security_field_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_primary_security_field
    ADD CONSTRAINT xdat_primary_security_field_primary_security_field_info_fkey FOREIGN KEY (primary_security_field_info) REFERENCES public.xdat_primary_security_field_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_primary_security_field xdat_primary_security_field_primary_security_fields_primar_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_primary_security_field
    ADD CONSTRAINT xdat_primary_security_field_primary_security_fields_primar_fkey FOREIGN KEY (primary_security_fields_primary_element_name) REFERENCES public.xdat_element_security(element_name) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_r_xdat_role_type_assign_xdat_user xdat_r_xdat_role_type_assign_xdat_u_xdat_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_r_xdat_role_type_assign_xdat_user
    ADD CONSTRAINT xdat_r_xdat_role_type_assign_xdat_u_xdat_user_xdat_user_id_fkey FOREIGN KEY (xdat_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_r_xdat_role_type_assign_xdat_user xdat_r_xdat_role_type_assign_xdat_xdat_role_type_role_name_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_r_xdat_role_type_assign_xdat_user
    ADD CONSTRAINT xdat_r_xdat_role_type_assign_xdat_xdat_role_type_role_name_fkey FOREIGN KEY (xdat_role_type_role_name) REFERENCES public.xdat_role_type(role_name) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_role_type_meta_data xdat_role_type_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_role_type_meta_data
    ADD CONSTRAINT xdat_role_type_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_role_type_meta_data xdat_role_type_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_role_type_meta_data
    ADD CONSTRAINT xdat_role_type_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_role_type xdat_role_type_role_type_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_role_type
    ADD CONSTRAINT xdat_role_type_role_type_info_fkey FOREIGN KEY (role_type_info) REFERENCES public.xdat_role_type_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_role_type xdat_role_type_roles_role_xdat_security_xdat_security_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_role_type
    ADD CONSTRAINT xdat_role_type_roles_role_xdat_security_xdat_security_id_fkey FOREIGN KEY (roles_role_xdat_security_xdat_security_id) REFERENCES public.xdat_security(xdat_security_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_search_field_meta_data xdat_search_field_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_search_field_meta_data
    ADD CONSTRAINT xdat_search_field_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_search_field_meta_data xdat_search_field_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_search_field_meta_data
    ADD CONSTRAINT xdat_search_field_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_search_field xdat_search_field_search_field_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_search_field
    ADD CONSTRAINT xdat_search_field_search_field_info_fkey FOREIGN KEY (search_field_info) REFERENCES public.xdat_search_field_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_search_field xdat_search_field_xdat_stored_search_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_search_field
    ADD CONSTRAINT xdat_search_field_xdat_stored_search_id_fkey FOREIGN KEY (xdat_stored_search_id) REFERENCES public.xdat_stored_search(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_search xdat_search_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_search
    ADD CONSTRAINT xdat_search_id_fkey FOREIGN KEY (id) REFERENCES public.xdat_stored_search(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_search_meta_data xdat_search_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_search_meta_data
    ADD CONSTRAINT xdat_search_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_search_meta_data xdat_search_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_search_meta_data
    ADD CONSTRAINT xdat_search_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_search xdat_search_search_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_search
    ADD CONSTRAINT xdat_search_search_info_fkey FOREIGN KEY (search_info) REFERENCES public.xdat_search_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_security xdat_security_infolist_info_xdat_infoentry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_security
    ADD CONSTRAINT xdat_security_infolist_info_xdat_infoentry_id_fkey FOREIGN KEY (infolist_info_xdat_infoentry_id) REFERENCES public.xdat_infoentry(xdat_infoentry_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_security_meta_data xdat_security_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_security_meta_data
    ADD CONSTRAINT xdat_security_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_security_meta_data xdat_security_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_security_meta_data
    ADD CONSTRAINT xdat_security_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_security xdat_security_newslist_news_xdat_newsentry_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_security
    ADD CONSTRAINT xdat_security_newslist_news_xdat_newsentry_id_fkey FOREIGN KEY (newslist_news_xdat_newsentry_id) REFERENCES public.xdat_newsentry(xdat_newsentry_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_security xdat_security_security_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_security
    ADD CONSTRAINT xdat_security_security_info_fkey FOREIGN KEY (security_info) REFERENCES public.xdat_security_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_stored_search_allowed_user_meta_data xdat_stored_search_allowed_us_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_stored_search_allowed_user_meta_data
    ADD CONSTRAINT xdat_stored_search_allowed_us_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_stored_search_allowed_user xdat_stored_search_allowed_us_stored_search_allowed_user_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_stored_search_allowed_user
    ADD CONSTRAINT xdat_stored_search_allowed_us_stored_search_allowed_user_i_fkey FOREIGN KEY (stored_search_allowed_user_info) REFERENCES public.xdat_stored_search_allowed_user_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_stored_search_allowed_user_meta_data xdat_stored_search_allowed_user_m_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_stored_search_allowed_user_meta_data
    ADD CONSTRAINT xdat_stored_search_allowed_user_m_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_stored_search_allowed_user xdat_stored_search_allowed_user_xdat_stored_search_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_stored_search_allowed_user
    ADD CONSTRAINT xdat_stored_search_allowed_user_xdat_stored_search_id_fkey FOREIGN KEY (xdat_stored_search_id) REFERENCES public.xdat_stored_search(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_stored_search xdat_stored_search_extension_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_stored_search
    ADD CONSTRAINT xdat_stored_search_extension_fkey FOREIGN KEY (extension) REFERENCES public.xdat_meta_element(xdat_meta_element_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_stored_search_groupid xdat_stored_search_groupid_allowed_groups_groupid_xdat_sto_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_stored_search_groupid
    ADD CONSTRAINT xdat_stored_search_groupid_allowed_groups_groupid_xdat_sto_fkey FOREIGN KEY (allowed_groups_groupid_xdat_sto_id) REFERENCES public.xdat_stored_search(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_stored_search_groupid_meta_data xdat_stored_search_groupid_me_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_stored_search_groupid_meta_data
    ADD CONSTRAINT xdat_stored_search_groupid_me_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_stored_search_groupid_meta_data xdat_stored_search_groupid_meta_d_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_stored_search_groupid_meta_data
    ADD CONSTRAINT xdat_stored_search_groupid_meta_d_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_stored_search_groupid xdat_stored_search_groupid_stored_search_groupid_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_stored_search_groupid
    ADD CONSTRAINT xdat_stored_search_groupid_stored_search_groupid_info_fkey FOREIGN KEY (stored_search_groupid_info) REFERENCES public.xdat_stored_search_groupid_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_stored_search_meta_data xdat_stored_search_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_stored_search_meta_data
    ADD CONSTRAINT xdat_stored_search_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_stored_search_meta_data xdat_stored_search_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_stored_search_meta_data
    ADD CONSTRAINT xdat_stored_search_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_stored_search xdat_stored_search_stored_search_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_stored_search
    ADD CONSTRAINT xdat_stored_search_stored_search_info_fkey FOREIGN KEY (stored_search_info) REFERENCES public.xdat_stored_search_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_user_groupid xdat_user_groupid_groupid_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_user_groupid
    ADD CONSTRAINT xdat_user_groupid_groupid_fkey FOREIGN KEY (groupid) REFERENCES public.xdat_usergroup(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_user_groupid xdat_user_groupid_groups_groupid_xdat_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_user_groupid
    ADD CONSTRAINT xdat_user_groupid_groups_groupid_xdat_user_xdat_user_id_fkey FOREIGN KEY (groups_groupid_xdat_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_user_groupid_meta_data xdat_user_groupid_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_user_groupid_meta_data
    ADD CONSTRAINT xdat_user_groupid_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_user_groupid_meta_data xdat_user_groupid_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_user_groupid_meta_data
    ADD CONSTRAINT xdat_user_groupid_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_user_groupid xdat_user_groupid_user_groupid_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_user_groupid
    ADD CONSTRAINT xdat_user_groupid_user_groupid_info_fkey FOREIGN KEY (user_groupid_info) REFERENCES public.xdat_user_groupid_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_user_login_meta_data xdat_user_login_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_user_login_meta_data
    ADD CONSTRAINT xdat_user_login_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_user_login_meta_data xdat_user_login_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_user_login_meta_data
    ADD CONSTRAINT xdat_user_login_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_user_login xdat_user_login_user_login_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_user_login
    ADD CONSTRAINT xdat_user_login_user_login_info_fkey FOREIGN KEY (user_login_info) REFERENCES public.xdat_user_login_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_user_login xdat_user_login_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_user_login
    ADD CONSTRAINT xdat_user_login_user_xdat_user_id_fkey FOREIGN KEY (user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_user_meta_data xdat_user_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_user_meta_data
    ADD CONSTRAINT xdat_user_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_user_meta_data xdat_user_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_user_meta_data
    ADD CONSTRAINT xdat_user_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_user xdat_user_user_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_user
    ADD CONSTRAINT xdat_user_user_info_fkey FOREIGN KEY (user_info) REFERENCES public.xdat_user_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_user xdat_user_users_user_xdat_security_xdat_security_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_user
    ADD CONSTRAINT xdat_user_users_user_xdat_security_xdat_security_id_fkey FOREIGN KEY (users_user_xdat_security_xdat_security_id) REFERENCES public.xdat_security(xdat_security_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_usergroup xdat_usergroup_groups_group_xdat_security_xdat_security_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_usergroup
    ADD CONSTRAINT xdat_usergroup_groups_group_xdat_security_xdat_security_id_fkey FOREIGN KEY (groups_group_xdat_security_xdat_security_id) REFERENCES public.xdat_security(xdat_security_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xdat_usergroup_meta_data xdat_usergroup_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_usergroup_meta_data
    ADD CONSTRAINT xdat_usergroup_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_usergroup_meta_data xdat_usergroup_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_usergroup_meta_data
    ADD CONSTRAINT xdat_usergroup_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xdat_usergroup xdat_usergroup_usergroup_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xdat_usergroup
    ADD CONSTRAINT xdat_usergroup_usergroup_info_fkey FOREIGN KEY (usergroup_info) REFERENCES public.xdat_usergroup_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_scidresearchdata xnat_a_scidresearchdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_scidresearchdata
    ADD CONSTRAINT xnat_a_scidresearchdata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_subjectassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_a_scidresearchdata_meta_data xnat_a_scidresearchdata_meta__activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_scidresearchdata_meta_data
    ADD CONSTRAINT xnat_a_scidresearchdata_meta__activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_scidresearchdata_meta_data xnat_a_scidresearchdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_scidresearchdata_meta_data
    ADD CONSTRAINT xnat_a_scidresearchdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_scidresearchdata xnat_a_scidresearchdata_scidresearchdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_scidresearchdata
    ADD CONSTRAINT xnat_a_scidresearchdata_scidresearchdata_info_fkey FOREIGN KEY (scidresearchdata_info) REFERENCES public.xnat_a_scidresearchdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_sideeffectspittsburghdata_meta_data xnat_a_sideeffectspittsburghd_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_sideeffectspittsburghdata_meta_data
    ADD CONSTRAINT xnat_a_sideeffectspittsburghd_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_sideeffectspittsburghdata xnat_a_sideeffectspittsburghd_sideeffectspittsburghdata_in_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_sideeffectspittsburghdata
    ADD CONSTRAINT xnat_a_sideeffectspittsburghd_sideeffectspittsburghdata_in_fkey FOREIGN KEY (sideeffectspittsburghdata_info) REFERENCES public.xnat_a_sideeffectspittsburghdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_sideeffectspittsburghdata_meta_data xnat_a_sideeffectspittsburghdata__insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_sideeffectspittsburghdata_meta_data
    ADD CONSTRAINT xnat_a_sideeffectspittsburghdata__insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_sideeffectspittsburghdata xnat_a_sideeffectspittsburghdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_sideeffectspittsburghdata
    ADD CONSTRAINT xnat_a_sideeffectspittsburghdata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_subjectassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_a_updrs3data xnat_a_updrs3data_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_updrs3data
    ADD CONSTRAINT xnat_a_updrs3data_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_subjectassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_a_updrs3data_meta_data xnat_a_updrs3data_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_updrs3data_meta_data
    ADD CONSTRAINT xnat_a_updrs3data_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_updrs3data_meta_data xnat_a_updrs3data_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_updrs3data_meta_data
    ADD CONSTRAINT xnat_a_updrs3data_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_updrs3data xnat_a_updrs3data_updrs3data_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_updrs3data
    ADD CONSTRAINT xnat_a_updrs3data_updrs3data_info_fkey FOREIGN KEY (updrs3data_info) REFERENCES public.xnat_a_updrs3data_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_ybocsdata xnat_a_ybocsdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_ybocsdata
    ADD CONSTRAINT xnat_a_ybocsdata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_subjectassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_a_ybocsdata_meta_data xnat_a_ybocsdata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_ybocsdata_meta_data
    ADD CONSTRAINT xnat_a_ybocsdata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_ybocsdata_meta_data xnat_a_ybocsdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_ybocsdata_meta_data
    ADD CONSTRAINT xnat_a_ybocsdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_ybocsdata xnat_a_ybocsdata_ybocsdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_ybocsdata
    ADD CONSTRAINT xnat_a_ybocsdata_ybocsdata_info_fkey FOREIGN KEY (ybocsdata_info) REFERENCES public.xnat_a_ybocsdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_ygtssdata xnat_a_ygtssdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_ygtssdata
    ADD CONSTRAINT xnat_a_ygtssdata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_subjectassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_a_ygtssdata_meta_data xnat_a_ygtssdata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_ygtssdata_meta_data
    ADD CONSTRAINT xnat_a_ygtssdata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_ygtssdata_meta_data xnat_a_ygtssdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_ygtssdata_meta_data
    ADD CONSTRAINT xnat_a_ygtssdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_a_ygtssdata xnat_a_ygtssdata_ygtssdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_a_ygtssdata
    ADD CONSTRAINT xnat_a_ygtssdata_ygtssdata_info_fkey FOREIGN KEY (ygtssdata_info) REFERENCES public.xnat_a_ygtssdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractdemographicdata_meta_data xnat_abstractdemographicdata__activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractdemographicdata_meta_data
    ADD CONSTRAINT xnat_abstractdemographicdata__activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractdemographicdata xnat_abstractdemographicdata_abstractdemographicdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractdemographicdata
    ADD CONSTRAINT xnat_abstractdemographicdata_abstractdemographicdata_info_fkey FOREIGN KEY (abstractdemographicdata_info) REFERENCES public.xnat_abstractdemographicdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractdemographicdata xnat_abstractdemographicdata_extension_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractdemographicdata
    ADD CONSTRAINT xnat_abstractdemographicdata_extension_fkey FOREIGN KEY (extension) REFERENCES public.xdat_meta_element(xdat_meta_element_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractdemographicdata_meta_data xnat_abstractdemographicdata_meta_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractdemographicdata_meta_data
    ADD CONSTRAINT xnat_abstractdemographicdata_meta_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractprotocol xnat_abstractprotocol_abstractprotocol_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractprotocol
    ADD CONSTRAINT xnat_abstractprotocol_abstractprotocol_info_fkey FOREIGN KEY (abstractprotocol_info) REFERENCES public.xnat_abstractprotocol_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractprotocol xnat_abstractprotocol_extension_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractprotocol
    ADD CONSTRAINT xnat_abstractprotocol_extension_fkey FOREIGN KEY (extension) REFERENCES public.xdat_meta_element(xdat_meta_element_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractprotocol_meta_data xnat_abstractprotocol_meta_da_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractprotocol_meta_data
    ADD CONSTRAINT xnat_abstractprotocol_meta_da_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractprotocol_meta_data xnat_abstractprotocol_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractprotocol_meta_data
    ADD CONSTRAINT xnat_abstractprotocol_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractprotocol xnat_abstractprotocol_xnat_projectdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractprotocol
    ADD CONSTRAINT xnat_abstractprotocol_xnat_projectdata_id_fkey FOREIGN KEY (xnat_projectdata_id) REFERENCES public.xnat_projectdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_abstractresource xnat_abstractresource_abstractresource_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractresource
    ADD CONSTRAINT xnat_abstractresource_abstractresource_info_fkey FOREIGN KEY (abstractresource_info) REFERENCES public.xnat_abstractresource_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractresource xnat_abstractresource_extension_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractresource
    ADD CONSTRAINT xnat_abstractresource_extension_fkey FOREIGN KEY (extension) REFERENCES public.xdat_meta_element(xdat_meta_element_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractresource_meta_data xnat_abstractresource_meta_da_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractresource_meta_data
    ADD CONSTRAINT xnat_abstractresource_meta_da_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractresource_meta_data xnat_abstractresource_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractresource_meta_data
    ADD CONSTRAINT xnat_abstractresource_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractresource_tag xnat_abstractresource_tag_abstractresource_tag_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractresource_tag
    ADD CONSTRAINT xnat_abstractresource_tag_abstractresource_tag_info_fkey FOREIGN KEY (abstractresource_tag_info) REFERENCES public.xnat_abstractresource_tag_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractresource_tag_meta_data xnat_abstractresource_tag_met_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractresource_tag_meta_data
    ADD CONSTRAINT xnat_abstractresource_tag_met_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractresource_tag_meta_data xnat_abstractresource_tag_meta_da_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractresource_tag_meta_data
    ADD CONSTRAINT xnat_abstractresource_tag_meta_da_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractresource_tag xnat_abstractresource_tag_tags_tag_xnat_abstractresource_x_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractresource_tag
    ADD CONSTRAINT xnat_abstractresource_tag_tags_tag_xnat_abstractresource_x_fkey FOREIGN KEY (tags_tag_xnat_abstractresource_xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_abstractresource xnat_abstractresource_xnat_imagescandata_xnat_imagescandat_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractresource
    ADD CONSTRAINT xnat_abstractresource_xnat_imagescandata_xnat_imagescandat_fkey FOREIGN KEY (xnat_imagescandata_xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_abstractstatistics xnat_abstractstatistics_abstractstatistics_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractstatistics
    ADD CONSTRAINT xnat_abstractstatistics_abstractstatistics_info_fkey FOREIGN KEY (abstractstatistics_info) REFERENCES public.xnat_abstractstatistics_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractstatistics xnat_abstractstatistics_extension_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractstatistics
    ADD CONSTRAINT xnat_abstractstatistics_extension_fkey FOREIGN KEY (extension) REFERENCES public.xdat_meta_element(xdat_meta_element_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractstatistics_meta_data xnat_abstractstatistics_meta__activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractstatistics_meta_data
    ADD CONSTRAINT xnat_abstractstatistics_meta__activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractstatistics_meta_data xnat_abstractstatistics_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractstatistics_meta_data
    ADD CONSTRAINT xnat_abstractstatistics_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractsubjectmetadata_meta_data xnat_abstractsubjectmetadata__activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractsubjectmetadata_meta_data
    ADD CONSTRAINT xnat_abstractsubjectmetadata__activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractsubjectmetadata xnat_abstractsubjectmetadata_abstractsubjectmetadata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractsubjectmetadata
    ADD CONSTRAINT xnat_abstractsubjectmetadata_abstractsubjectmetadata_info_fkey FOREIGN KEY (abstractsubjectmetadata_info) REFERENCES public.xnat_abstractsubjectmetadata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractsubjectmetadata xnat_abstractsubjectmetadata_extension_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractsubjectmetadata
    ADD CONSTRAINT xnat_abstractsubjectmetadata_extension_fkey FOREIGN KEY (extension) REFERENCES public.xdat_meta_element(xdat_meta_element_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_abstractsubjectmetadata_meta_data xnat_abstractsubjectmetadata_meta_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_abstractsubjectmetadata_meta_data
    ADD CONSTRAINT xnat_abstractsubjectmetadata_meta_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_addfield xnat_addfield_addfield_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_addfield
    ADD CONSTRAINT xnat_addfield_addfield_info_fkey FOREIGN KEY (addfield_info) REFERENCES public.xnat_addfield_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_addfield_meta_data xnat_addfield_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_addfield_meta_data
    ADD CONSTRAINT xnat_addfield_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_addfield_meta_data xnat_addfield_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_addfield_meta_data
    ADD CONSTRAINT xnat_addfield_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_addfield xnat_addfield_parameters_addparam_xnat_imagea_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_addfield
    ADD CONSTRAINT xnat_addfield_parameters_addparam_xnat_imagea_id_fkey FOREIGN KEY (parameters_addparam_xnat_imagea_id) REFERENCES public.xnat_imageassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_addfield xnat_addfield_parameters_addparam_xnat_mrscan_xnat_imagesc_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_addfield
    ADD CONSTRAINT xnat_addfield_parameters_addparam_xnat_mrscan_xnat_imagesc_fkey FOREIGN KEY (parameters_addparam_xnat_mrscan_xnat_imagescandata_id) REFERENCES public.xnat_mrscandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_addfield xnat_addfield_parameters_addparam_xnat_petsca_xnat_imagesc_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_addfield
    ADD CONSTRAINT xnat_addfield_parameters_addparam_xnat_petsca_xnat_imagesc_fkey FOREIGN KEY (parameters_addparam_xnat_petsca_xnat_imagescandata_id) REFERENCES public.xnat_petscandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_addfield xnat_addfield_parameters_addparam_xnat_recons_xnat_reconst_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_addfield
    ADD CONSTRAINT xnat_addfield_parameters_addparam_xnat_recons_xnat_reconst_fkey FOREIGN KEY (parameters_addparam_xnat_recons_xnat_reconstructedimagedata_id) REFERENCES public.xnat_reconstructedimagedata(xnat_reconstructedimagedata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_algorithm xnat_algorithm_algorithm_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_algorithm
    ADD CONSTRAINT xnat_algorithm_algorithm_info_fkey FOREIGN KEY (algorithm_info) REFERENCES public.xnat_algorithm_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_algorithm xnat_algorithm_family_xnat_dicomcodedvalue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_algorithm
    ADD CONSTRAINT xnat_algorithm_family_xnat_dicomcodedvalue_id_fkey FOREIGN KEY (family_xnat_dicomcodedvalue_id) REFERENCES public.xnat_dicomcodedvalue(xnat_dicomcodedvalue_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_algorithm_meta_data xnat_algorithm_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_algorithm_meta_data
    ADD CONSTRAINT xnat_algorithm_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_algorithm_meta_data xnat_algorithm_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_algorithm_meta_data
    ADD CONSTRAINT xnat_algorithm_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_algorithm xnat_algorithm_namecode_xnat_dicomcodedvalue_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_algorithm
    ADD CONSTRAINT xnat_algorithm_namecode_xnat_dicomcodedvalue_id_fkey FOREIGN KEY (namecode_xnat_dicomcodedvalue_id) REFERENCES public.xnat_dicomcodedvalue(xnat_dicomcodedvalue_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_computationdata xnat_computationdata_computationdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_computationdata
    ADD CONSTRAINT xnat_computationdata_computationdata_info_fkey FOREIGN KEY (computationdata_info) REFERENCES public.xnat_computationdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_computationdata xnat_computationdata_computations_datum_xnat_reconst_xnat__fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_computationdata
    ADD CONSTRAINT xnat_computationdata_computations_datum_xnat_reconst_xnat__fkey FOREIGN KEY (computations_datum_xnat_reconst_xnat_reconstructedimagedata_id) REFERENCES public.xnat_reconstructedimagedata(xnat_reconstructedimagedata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_computationdata_meta_data xnat_computationdata_meta_dat_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_computationdata_meta_data
    ADD CONSTRAINT xnat_computationdata_meta_dat_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_computationdata_meta_data xnat_computationdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_computationdata_meta_data
    ADD CONSTRAINT xnat_computationdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_contrastbolus xnat_contrastbolus_contrastbolus_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_contrastbolus
    ADD CONSTRAINT xnat_contrastbolus_contrastbolus_info_fkey FOREIGN KEY (contrastbolus_info) REFERENCES public.xnat_contrastbolus_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_contrastbolus_meta_data xnat_contrastbolus_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_contrastbolus_meta_data
    ADD CONSTRAINT xnat_contrastbolus_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_contrastbolus_meta_data xnat_contrastbolus_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_contrastbolus_meta_data
    ADD CONSTRAINT xnat_contrastbolus_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_crscandata xnat_crscandata_crscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_crscandata
    ADD CONSTRAINT xnat_crscandata_crscandata_info_fkey FOREIGN KEY (crscandata_info) REFERENCES public.xnat_crscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_crscandata_meta_data xnat_crscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_crscandata_meta_data
    ADD CONSTRAINT xnat_crscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_crscandata_meta_data xnat_crscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_crscandata_meta_data
    ADD CONSTRAINT xnat_crscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_crscandata xnat_crscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_crscandata
    ADD CONSTRAINT xnat_crscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_crsessiondata xnat_crsessiondata_crsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_crsessiondata
    ADD CONSTRAINT xnat_crsessiondata_crsessiondata_info_fkey FOREIGN KEY (crsessiondata_info) REFERENCES public.xnat_crsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_crsessiondata xnat_crsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_crsessiondata
    ADD CONSTRAINT xnat_crsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_crsessiondata_meta_data xnat_crsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_crsessiondata_meta_data
    ADD CONSTRAINT xnat_crsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_crsessiondata_meta_data xnat_crsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_crsessiondata_meta_data
    ADD CONSTRAINT xnat_crsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ctscandata xnat_ctscandata_ctscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ctscandata
    ADD CONSTRAINT xnat_ctscandata_ctscandata_info_fkey FOREIGN KEY (ctscandata_info) REFERENCES public.xnat_ctscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ctscandata_focalspot xnat_ctscandata_focalspot_ctscandata_focalspot_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ctscandata_focalspot
    ADD CONSTRAINT xnat_ctscandata_focalspot_ctscandata_focalspot_info_fkey FOREIGN KEY (ctscandata_focalspot_info) REFERENCES public.xnat_ctscandata_focalspot_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ctscandata_focalspot_meta_data xnat_ctscandata_focalspot_met_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ctscandata_focalspot_meta_data
    ADD CONSTRAINT xnat_ctscandata_focalspot_met_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ctscandata_focalspot_meta_data xnat_ctscandata_focalspot_meta_da_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ctscandata_focalspot_meta_data
    ADD CONSTRAINT xnat_ctscandata_focalspot_meta_da_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ctscandata_focalspot xnat_ctscandata_focalspot_parameters_focalspots_focalspot__fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ctscandata_focalspot
    ADD CONSTRAINT xnat_ctscandata_focalspot_parameters_focalspots_focalspot__fkey FOREIGN KEY (parameters_focalspots_focalspot_xnat_imagescandata_id) REFERENCES public.xnat_ctscandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_ctscandata_meta_data xnat_ctscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ctscandata_meta_data
    ADD CONSTRAINT xnat_ctscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ctscandata_meta_data xnat_ctscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ctscandata_meta_data
    ADD CONSTRAINT xnat_ctscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ctscandata xnat_ctscandata_parameters_contrastbolus_xnat_contrastbolu_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ctscandata
    ADD CONSTRAINT xnat_ctscandata_parameters_contrastbolus_xnat_contrastbolu_fkey FOREIGN KEY (parameters_contrastbolus_xnat_contrastbolus_id) REFERENCES public.xnat_contrastbolus(xnat_contrastbolus_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ctscandata xnat_ctscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ctscandata
    ADD CONSTRAINT xnat_ctscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_ctsessiondata xnat_ctsessiondata_ctsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ctsessiondata
    ADD CONSTRAINT xnat_ctsessiondata_ctsessiondata_info_fkey FOREIGN KEY (ctsessiondata_info) REFERENCES public.xnat_ctsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ctsessiondata xnat_ctsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ctsessiondata
    ADD CONSTRAINT xnat_ctsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_ctsessiondata_meta_data xnat_ctsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ctsessiondata_meta_data
    ADD CONSTRAINT xnat_ctsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ctsessiondata_meta_data xnat_ctsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ctsessiondata_meta_data
    ADD CONSTRAINT xnat_ctsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_datatypeprotocol xnat_datatypeprotocol_datatypeprotocol_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_datatypeprotocol
    ADD CONSTRAINT xnat_datatypeprotocol_datatypeprotocol_info_fkey FOREIGN KEY (datatypeprotocol_info) REFERENCES public.xnat_datatypeprotocol_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_datatypeprotocol_fieldgroups xnat_datatypeprotocol_fieldgr_xnat_datatypeprotocol_xnat_a_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_datatypeprotocol_fieldgroups
    ADD CONSTRAINT xnat_datatypeprotocol_fieldgr_xnat_datatypeprotocol_xnat_a_fkey FOREIGN KEY (xnat_datatypeprotocol_xnat_abstractprotocol_id) REFERENCES public.xnat_datatypeprotocol(xnat_abstractprotocol_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_datatypeprotocol_fieldgroups xnat_datatypeprotocol_fieldgr_xnat_fielddefinitiongroup_xn_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_datatypeprotocol_fieldgroups
    ADD CONSTRAINT xnat_datatypeprotocol_fieldgr_xnat_fielddefinitiongroup_xn_fkey FOREIGN KEY (xnat_fielddefinitiongroup_xnat_fielddefinitiongroup_id) REFERENCES public.xnat_fielddefinitiongroup(xnat_fielddefinitiongroup_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_datatypeprotocol_meta_data xnat_datatypeprotocol_meta_da_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_datatypeprotocol_meta_data
    ADD CONSTRAINT xnat_datatypeprotocol_meta_da_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_datatypeprotocol_meta_data xnat_datatypeprotocol_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_datatypeprotocol_meta_data
    ADD CONSTRAINT xnat_datatypeprotocol_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_datatypeprotocol xnat_datatypeprotocol_xnat_abstractprotocol_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_datatypeprotocol
    ADD CONSTRAINT xnat_datatypeprotocol_xnat_abstractprotocol_id_fkey FOREIGN KEY (xnat_abstractprotocol_id) REFERENCES public.xnat_abstractprotocol(xnat_abstractprotocol_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_demographicdata xnat_demographicdata_demographicdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_demographicdata
    ADD CONSTRAINT xnat_demographicdata_demographicdata_info_fkey FOREIGN KEY (demographicdata_info) REFERENCES public.xnat_demographicdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_demographicdata_meta_data xnat_demographicdata_meta_dat_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_demographicdata_meta_data
    ADD CONSTRAINT xnat_demographicdata_meta_dat_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_demographicdata_meta_data xnat_demographicdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_demographicdata_meta_data
    ADD CONSTRAINT xnat_demographicdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_demographicdata xnat_demographicdata_xnat_abstractdemographicdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_demographicdata
    ADD CONSTRAINT xnat_demographicdata_xnat_abstractdemographicdata_id_fkey FOREIGN KEY (xnat_abstractdemographicdata_id) REFERENCES public.xnat_abstractdemographicdata(xnat_abstractdemographicdata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_deriveddata xnat_deriveddata_deriveddata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_deriveddata
    ADD CONSTRAINT xnat_deriveddata_deriveddata_info_fkey FOREIGN KEY (deriveddata_info) REFERENCES public.xnat_deriveddata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_deriveddata xnat_deriveddata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_deriveddata
    ADD CONSTRAINT xnat_deriveddata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_experimentdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_deriveddata_meta_data xnat_deriveddata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_deriveddata_meta_data
    ADD CONSTRAINT xnat_deriveddata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_deriveddata_meta_data xnat_deriveddata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_deriveddata_meta_data
    ADD CONSTRAINT xnat_deriveddata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_deriveddata xnat_deriveddata_provenance_prov_process_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_deriveddata
    ADD CONSTRAINT xnat_deriveddata_provenance_prov_process_id_fkey FOREIGN KEY (provenance_prov_process_id) REFERENCES public.prov_process(prov_process_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dicomcodedvalue xnat_dicomcodedvalue_dicomcodedvalue_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dicomcodedvalue
    ADD CONSTRAINT xnat_dicomcodedvalue_dicomcodedvalue_info_fkey FOREIGN KEY (dicomcodedvalue_info) REFERENCES public.xnat_dicomcodedvalue_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dicomcodedvalue_meta_data xnat_dicomcodedvalue_meta_dat_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dicomcodedvalue_meta_data
    ADD CONSTRAINT xnat_dicomcodedvalue_meta_dat_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dicomcodedvalue_meta_data xnat_dicomcodedvalue_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dicomcodedvalue_meta_data
    ADD CONSTRAINT xnat_dicomcodedvalue_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dicomseries xnat_dicomseries_dicomseries_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dicomseries
    ADD CONSTRAINT xnat_dicomseries_dicomseries_info_fkey FOREIGN KEY (dicomseries_info) REFERENCES public.xnat_dicomseries_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dicomseries_image xnat_dicomseries_image_dicomseries_image_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dicomseries_image
    ADD CONSTRAINT xnat_dicomseries_image_dicomseries_image_info_fkey FOREIGN KEY (dicomseries_image_info) REFERENCES public.xnat_dicomseries_image_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dicomseries_image xnat_dicomseries_image_imageset_image_xnat_dicomseries_xna_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dicomseries_image
    ADD CONSTRAINT xnat_dicomseries_image_imageset_image_xnat_dicomseries_xna_fkey FOREIGN KEY (imageset_image_xnat_dicomseries_xnat_abstractresource_id) REFERENCES public.xnat_dicomseries(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_dicomseries_image_meta_data xnat_dicomseries_image_meta_d_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dicomseries_image_meta_data
    ADD CONSTRAINT xnat_dicomseries_image_meta_d_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dicomseries_image_meta_data xnat_dicomseries_image_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dicomseries_image_meta_data
    ADD CONSTRAINT xnat_dicomseries_image_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dicomseries_meta_data xnat_dicomseries_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dicomseries_meta_data
    ADD CONSTRAINT xnat_dicomseries_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dicomseries_meta_data xnat_dicomseries_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dicomseries_meta_data
    ADD CONSTRAINT xnat_dicomseries_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dicomseries xnat_dicomseries_xnat_abstractresource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dicomseries
    ADD CONSTRAINT xnat_dicomseries_xnat_abstractresource_id_fkey FOREIGN KEY (xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_dx3dcraniofacialscandata_meta_data xnat_dx3dcraniofacialscandata_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dx3dcraniofacialscandata_meta_data
    ADD CONSTRAINT xnat_dx3dcraniofacialscandata_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dx3dcraniofacialscandata xnat_dx3dcraniofacialscandata_dx3dcraniofacialscandata_inf_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dx3dcraniofacialscandata
    ADD CONSTRAINT xnat_dx3dcraniofacialscandata_dx3dcraniofacialscandata_inf_fkey FOREIGN KEY (dx3dcraniofacialscandata_info) REFERENCES public.xnat_dx3dcraniofacialscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dx3dcraniofacialscandata_meta_data xnat_dx3dcraniofacialscandata_met_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dx3dcraniofacialscandata_meta_data
    ADD CONSTRAINT xnat_dx3dcraniofacialscandata_met_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dx3dcraniofacialscandata xnat_dx3dcraniofacialscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dx3dcraniofacialscandata
    ADD CONSTRAINT xnat_dx3dcraniofacialscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_dx3dcraniofacialsessiondata_meta_data xnat_dx3dcraniofacialsessiond_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dx3dcraniofacialsessiondata_meta_data
    ADD CONSTRAINT xnat_dx3dcraniofacialsessiond_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dx3dcraniofacialsessiondata xnat_dx3dcraniofacialsessiond_dx3dcraniofacialsessiondata__fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dx3dcraniofacialsessiondata
    ADD CONSTRAINT xnat_dx3dcraniofacialsessiond_dx3dcraniofacialsessiondata__fkey FOREIGN KEY (dx3dcraniofacialsessiondata_info) REFERENCES public.xnat_dx3dcraniofacialsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dx3dcraniofacialsessiondata_meta_data xnat_dx3dcraniofacialsessiondata__insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dx3dcraniofacialsessiondata_meta_data
    ADD CONSTRAINT xnat_dx3dcraniofacialsessiondata__insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dx3dcraniofacialsessiondata xnat_dx3dcraniofacialsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dx3dcraniofacialsessiondata
    ADD CONSTRAINT xnat_dx3dcraniofacialsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_dxscandata xnat_dxscandata_dxscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dxscandata
    ADD CONSTRAINT xnat_dxscandata_dxscandata_info_fkey FOREIGN KEY (dxscandata_info) REFERENCES public.xnat_dxscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dxscandata_meta_data xnat_dxscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dxscandata_meta_data
    ADD CONSTRAINT xnat_dxscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dxscandata_meta_data xnat_dxscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dxscandata_meta_data
    ADD CONSTRAINT xnat_dxscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dxscandata xnat_dxscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dxscandata
    ADD CONSTRAINT xnat_dxscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_dxsessiondata xnat_dxsessiondata_dxsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dxsessiondata
    ADD CONSTRAINT xnat_dxsessiondata_dxsessiondata_info_fkey FOREIGN KEY (dxsessiondata_info) REFERENCES public.xnat_dxsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dxsessiondata xnat_dxsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dxsessiondata
    ADD CONSTRAINT xnat_dxsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_dxsessiondata_meta_data xnat_dxsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dxsessiondata_meta_data
    ADD CONSTRAINT xnat_dxsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_dxsessiondata_meta_data xnat_dxsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_dxsessiondata_meta_data
    ADD CONSTRAINT xnat_dxsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ecgscandata xnat_ecgscandata_ecgscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ecgscandata
    ADD CONSTRAINT xnat_ecgscandata_ecgscandata_info_fkey FOREIGN KEY (ecgscandata_info) REFERENCES public.xnat_ecgscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ecgscandata_meta_data xnat_ecgscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ecgscandata_meta_data
    ADD CONSTRAINT xnat_ecgscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ecgscandata_meta_data xnat_ecgscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ecgscandata_meta_data
    ADD CONSTRAINT xnat_ecgscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ecgscandata xnat_ecgscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ecgscandata
    ADD CONSTRAINT xnat_ecgscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_ecgsessiondata xnat_ecgsessiondata_ecgsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ecgsessiondata
    ADD CONSTRAINT xnat_ecgsessiondata_ecgsessiondata_info_fkey FOREIGN KEY (ecgsessiondata_info) REFERENCES public.xnat_ecgsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ecgsessiondata xnat_ecgsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ecgsessiondata
    ADD CONSTRAINT xnat_ecgsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_ecgsessiondata_meta_data xnat_ecgsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ecgsessiondata_meta_data
    ADD CONSTRAINT xnat_ecgsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ecgsessiondata_meta_data xnat_ecgsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ecgsessiondata_meta_data
    ADD CONSTRAINT xnat_ecgsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_eegscandata_channel xnat_eegscandata_channel_channels_channel_xnat_eegscanda_x_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegscandata_channel
    ADD CONSTRAINT xnat_eegscandata_channel_channels_channel_xnat_eegscanda_x_fkey FOREIGN KEY (channels_channel_xnat_eegscanda_xnat_imagescandata_id) REFERENCES public.xnat_eegscandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_eegscandata_channel xnat_eegscandata_channel_eegscandata_channel_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegscandata_channel
    ADD CONSTRAINT xnat_eegscandata_channel_eegscandata_channel_info_fkey FOREIGN KEY (eegscandata_channel_info) REFERENCES public.xnat_eegscandata_channel_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_eegscandata_channel_meta_data xnat_eegscandata_channel_meta_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegscandata_channel_meta_data
    ADD CONSTRAINT xnat_eegscandata_channel_meta_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_eegscandata_channel_meta_data xnat_eegscandata_channel_meta_dat_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegscandata_channel_meta_data
    ADD CONSTRAINT xnat_eegscandata_channel_meta_dat_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_eegscandata xnat_eegscandata_eegscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegscandata
    ADD CONSTRAINT xnat_eegscandata_eegscandata_info_fkey FOREIGN KEY (eegscandata_info) REFERENCES public.xnat_eegscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_eegscandata_impedance xnat_eegscandata_impedance_eegscandata_impedance_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegscandata_impedance
    ADD CONSTRAINT xnat_eegscandata_impedance_eegscandata_impedance_info_fkey FOREIGN KEY (eegscandata_impedance_info) REFERENCES public.xnat_eegscandata_impedance_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_eegscandata_impedance_meta_data xnat_eegscandata_impedance_me_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegscandata_impedance_meta_data
    ADD CONSTRAINT xnat_eegscandata_impedance_me_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_eegscandata_impedance_meta_data xnat_eegscandata_impedance_meta_d_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegscandata_impedance_meta_data
    ADD CONSTRAINT xnat_eegscandata_impedance_meta_d_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_eegscandata_impedance xnat_eegscandata_impedance_softwarefiltersimpedances_imped_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegscandata_impedance
    ADD CONSTRAINT xnat_eegscandata_impedance_softwarefiltersimpedances_imped_fkey FOREIGN KEY (softwarefiltersimpedances_imped_xnat_imagescandata_id) REFERENCES public.xnat_eegscandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_eegscandata_meta_data xnat_eegscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegscandata_meta_data
    ADD CONSTRAINT xnat_eegscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_eegscandata_meta_data xnat_eegscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegscandata_meta_data
    ADD CONSTRAINT xnat_eegscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_eegscandata xnat_eegscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegscandata
    ADD CONSTRAINT xnat_eegscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_eegsessiondata xnat_eegsessiondata_eegsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegsessiondata
    ADD CONSTRAINT xnat_eegsessiondata_eegsessiondata_info_fkey FOREIGN KEY (eegsessiondata_info) REFERENCES public.xnat_eegsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_eegsessiondata xnat_eegsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegsessiondata
    ADD CONSTRAINT xnat_eegsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_eegsessiondata_meta_data xnat_eegsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegsessiondata_meta_data
    ADD CONSTRAINT xnat_eegsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_eegsessiondata_meta_data xnat_eegsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_eegsessiondata_meta_data
    ADD CONSTRAINT xnat_eegsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_epsscandata xnat_epsscandata_epsscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_epsscandata
    ADD CONSTRAINT xnat_epsscandata_epsscandata_info_fkey FOREIGN KEY (epsscandata_info) REFERENCES public.xnat_epsscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_epsscandata_meta_data xnat_epsscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_epsscandata_meta_data
    ADD CONSTRAINT xnat_epsscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_epsscandata_meta_data xnat_epsscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_epsscandata_meta_data
    ADD CONSTRAINT xnat_epsscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_epsscandata xnat_epsscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_epsscandata
    ADD CONSTRAINT xnat_epsscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_epssessiondata xnat_epssessiondata_epssessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_epssessiondata
    ADD CONSTRAINT xnat_epssessiondata_epssessiondata_info_fkey FOREIGN KEY (epssessiondata_info) REFERENCES public.xnat_epssessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_epssessiondata xnat_epssessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_epssessiondata
    ADD CONSTRAINT xnat_epssessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_epssessiondata_meta_data xnat_epssessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_epssessiondata_meta_data
    ADD CONSTRAINT xnat_epssessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_epssessiondata_meta_data xnat_epssessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_epssessiondata_meta_data
    ADD CONSTRAINT xnat_epssessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_esscandata xnat_esscandata_esscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_esscandata
    ADD CONSTRAINT xnat_esscandata_esscandata_info_fkey FOREIGN KEY (esscandata_info) REFERENCES public.xnat_esscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_esscandata_meta_data xnat_esscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_esscandata_meta_data
    ADD CONSTRAINT xnat_esscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_esscandata_meta_data xnat_esscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_esscandata_meta_data
    ADD CONSTRAINT xnat_esscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_esscandata xnat_esscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_esscandata
    ADD CONSTRAINT xnat_esscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_essessiondata xnat_essessiondata_essessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_essessiondata
    ADD CONSTRAINT xnat_essessiondata_essessiondata_info_fkey FOREIGN KEY (essessiondata_info) REFERENCES public.xnat_essessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_essessiondata xnat_essessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_essessiondata
    ADD CONSTRAINT xnat_essessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_essessiondata_meta_data xnat_essessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_essessiondata_meta_data
    ADD CONSTRAINT xnat_essessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_essessiondata_meta_data xnat_essessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_essessiondata_meta_data
    ADD CONSTRAINT xnat_essessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_esvscandata xnat_esvscandata_esvscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_esvscandata
    ADD CONSTRAINT xnat_esvscandata_esvscandata_info_fkey FOREIGN KEY (esvscandata_info) REFERENCES public.xnat_esvscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_esvscandata_meta_data xnat_esvscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_esvscandata_meta_data
    ADD CONSTRAINT xnat_esvscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_esvscandata_meta_data xnat_esvscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_esvscandata_meta_data
    ADD CONSTRAINT xnat_esvscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_esvscandata xnat_esvscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_esvscandata
    ADD CONSTRAINT xnat_esvscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_esvsessiondata xnat_esvsessiondata_esvsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_esvsessiondata
    ADD CONSTRAINT xnat_esvsessiondata_esvsessiondata_info_fkey FOREIGN KEY (esvsessiondata_info) REFERENCES public.xnat_esvsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_esvsessiondata xnat_esvsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_esvsessiondata
    ADD CONSTRAINT xnat_esvsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_esvsessiondata_meta_data xnat_esvsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_esvsessiondata_meta_data
    ADD CONSTRAINT xnat_esvsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_esvsessiondata_meta_data xnat_esvsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_esvsessiondata_meta_data
    ADD CONSTRAINT xnat_esvsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata xnat_experimentdata_experimentdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata
    ADD CONSTRAINT xnat_experimentdata_experimentdata_info_fkey FOREIGN KEY (experimentdata_info) REFERENCES public.xnat_experimentdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata xnat_experimentdata_extension_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata
    ADD CONSTRAINT xnat_experimentdata_extension_fkey FOREIGN KEY (extension) REFERENCES public.xdat_meta_element(xdat_meta_element_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata_field xnat_experimentdata_field_experimentdata_field_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_field
    ADD CONSTRAINT xnat_experimentdata_field_experimentdata_field_info_fkey FOREIGN KEY (experimentdata_field_info) REFERENCES public.xnat_experimentdata_field_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata_field xnat_experimentdata_field_fields_field_xnat_experimentdat__fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_field
    ADD CONSTRAINT xnat_experimentdata_field_fields_field_xnat_experimentdat__fkey FOREIGN KEY (fields_field_xnat_experimentdat_id) REFERENCES public.xnat_experimentdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_experimentdata_field_meta_data xnat_experimentdata_field_met_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_field_meta_data
    ADD CONSTRAINT xnat_experimentdata_field_met_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata_field_meta_data xnat_experimentdata_field_meta_da_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_field_meta_data
    ADD CONSTRAINT xnat_experimentdata_field_meta_da_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata xnat_experimentdata_investigator_xnat_investigatordata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata
    ADD CONSTRAINT xnat_experimentdata_investigator_xnat_investigatordata_id_fkey FOREIGN KEY (investigator_xnat_investigatordata_id) REFERENCES public.xnat_investigatordata(xnat_investigatordata_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata_meta_data xnat_experimentdata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_meta_data
    ADD CONSTRAINT xnat_experimentdata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata_meta_data xnat_experimentdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_meta_data
    ADD CONSTRAINT xnat_experimentdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata xnat_experimentdata_project_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata
    ADD CONSTRAINT xnat_experimentdata_project_fkey FOREIGN KEY (project) REFERENCES public.xnat_projectdata(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata_resource xnat_experimentdata_resource_xnat_abstractresource_xnat_ab_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_resource
    ADD CONSTRAINT xnat_experimentdata_resource_xnat_abstractresource_xnat_ab_fkey FOREIGN KEY (xnat_abstractresource_xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_experimentdata_resource xnat_experimentdata_resource_xnat_experimentdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_resource
    ADD CONSTRAINT xnat_experimentdata_resource_xnat_experimentdata_id_fkey FOREIGN KEY (xnat_experimentdata_id) REFERENCES public.xnat_experimentdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_experimentdata_share xnat_experimentdata_share_experimentdata_share_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_share
    ADD CONSTRAINT xnat_experimentdata_share_experimentdata_share_info_fkey FOREIGN KEY (experimentdata_share_info) REFERENCES public.xnat_experimentdata_share_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata_share_meta_data xnat_experimentdata_share_met_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_share_meta_data
    ADD CONSTRAINT xnat_experimentdata_share_met_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata_share_meta_data xnat_experimentdata_share_meta_da_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_share_meta_data
    ADD CONSTRAINT xnat_experimentdata_share_meta_da_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata_share xnat_experimentdata_share_project_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_share
    ADD CONSTRAINT xnat_experimentdata_share_project_fkey FOREIGN KEY (project) REFERENCES public.xnat_projectdata(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata_share xnat_experimentdata_share_sharing_share_xnat_experimentda__fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_share
    ADD CONSTRAINT xnat_experimentdata_share_sharing_share_xnat_experimentda__fkey FOREIGN KEY (sharing_share_xnat_experimentda_id) REFERENCES public.xnat_experimentdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_experimentdata_share xnat_experimentdata_share_visit_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata_share
    ADD CONSTRAINT xnat_experimentdata_share_visit_fkey FOREIGN KEY (visit) REFERENCES public.xnat_pvisitdata(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata xnat_experimentdata_validation_xnat_validationdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata
    ADD CONSTRAINT xnat_experimentdata_validation_xnat_validationdata_id_fkey FOREIGN KEY (validation_xnat_validationdata_id) REFERENCES public.xnat_validationdata(xnat_validationdata_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_experimentdata xnat_experimentdata_visit_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_experimentdata
    ADD CONSTRAINT xnat_experimentdata_visit_fkey FOREIGN KEY (visit) REFERENCES public.xnat_pvisitdata(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_fielddefinitiongroup_field_meta_data xnat_fielddefinitiongroup_fi_activation_user_xdat_user_id_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_fielddefinitiongroup_field_meta_data
    ADD CONSTRAINT xnat_fielddefinitiongroup_fi_activation_user_xdat_user_id_fkey1 FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_fielddefinitiongroup_field_possiblevalue_meta_data xnat_fielddefinitiongroup_fie_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_fielddefinitiongroup_field_possiblevalue_meta_data
    ADD CONSTRAINT xnat_fielddefinitiongroup_fie_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_fielddefinitiongroup_field xnat_fielddefinitiongroup_fie_fielddefinitiongroup_field_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_fielddefinitiongroup_field
    ADD CONSTRAINT xnat_fielddefinitiongroup_fie_fielddefinitiongroup_field_i_fkey FOREIGN KEY (fielddefinitiongroup_field_info) REFERENCES public.xnat_fielddefinitiongroup_field_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_fielddefinitiongroup_field_possiblevalue xnat_fielddefinitiongroup_fie_fielddefinitiongroup_field_p_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_fielddefinitiongroup_field_possiblevalue
    ADD CONSTRAINT xnat_fielddefinitiongroup_fie_fielddefinitiongroup_field_p_fkey FOREIGN KEY (fielddefinitiongroup_field_possiblevalue_info) REFERENCES public.xnat_fielddefinitiongroup_field_possiblevalue_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_fielddefinitiongroup_field xnat_fielddefinitiongroup_fie_fields_field_xnat_fielddefin_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_fielddefinitiongroup_field
    ADD CONSTRAINT xnat_fielddefinitiongroup_fie_fields_field_xnat_fielddefin_fkey FOREIGN KEY (fields_field_xnat_fielddefiniti_xnat_fielddefinitiongroup_id) REFERENCES public.xnat_fielddefinitiongroup(xnat_fielddefinitiongroup_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_fielddefinitiongroup_field_possiblevalue xnat_fielddefinitiongroup_fie_possiblevalues_possiblevalue_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_fielddefinitiongroup_field_possiblevalue
    ADD CONSTRAINT xnat_fielddefinitiongroup_fie_possiblevalues_possiblevalue_fkey FOREIGN KEY (possiblevalues_possiblevalue_xn_xnat_fielddefinitiongroup_field) REFERENCES public.xnat_fielddefinitiongroup_field(xnat_fielddefinitiongroup_field_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_fielddefinitiongroup_field_meta_data xnat_fielddefinitiongroup_field_m_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_fielddefinitiongroup_field_meta_data
    ADD CONSTRAINT xnat_fielddefinitiongroup_field_m_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_fielddefinitiongroup_field_possiblevalue_meta_data xnat_fielddefinitiongroup_field_p_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_fielddefinitiongroup_field_possiblevalue_meta_data
    ADD CONSTRAINT xnat_fielddefinitiongroup_field_p_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_fielddefinitiongroup xnat_fielddefinitiongroup_fielddefinitiongroup_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_fielddefinitiongroup
    ADD CONSTRAINT xnat_fielddefinitiongroup_fielddefinitiongroup_info_fkey FOREIGN KEY (fielddefinitiongroup_info) REFERENCES public.xnat_fielddefinitiongroup_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_fielddefinitiongroup_meta_data xnat_fielddefinitiongroup_met_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_fielddefinitiongroup_meta_data
    ADD CONSTRAINT xnat_fielddefinitiongroup_met_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_fielddefinitiongroup_meta_data xnat_fielddefinitiongroup_meta_da_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_fielddefinitiongroup_meta_data
    ADD CONSTRAINT xnat_fielddefinitiongroup_meta_da_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_genericdata xnat_genericdata_genericdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_genericdata
    ADD CONSTRAINT xnat_genericdata_genericdata_info_fkey FOREIGN KEY (genericdata_info) REFERENCES public.xnat_genericdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_genericdata xnat_genericdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_genericdata
    ADD CONSTRAINT xnat_genericdata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_experimentdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_genericdata_meta_data xnat_genericdata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_genericdata_meta_data
    ADD CONSTRAINT xnat_genericdata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_genericdata_meta_data xnat_genericdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_genericdata_meta_data
    ADD CONSTRAINT xnat_genericdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_gmscandata xnat_gmscandata_gmscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmscandata
    ADD CONSTRAINT xnat_gmscandata_gmscandata_info_fkey FOREIGN KEY (gmscandata_info) REFERENCES public.xnat_gmscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_gmscandata_meta_data xnat_gmscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmscandata_meta_data
    ADD CONSTRAINT xnat_gmscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_gmscandata_meta_data xnat_gmscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmscandata_meta_data
    ADD CONSTRAINT xnat_gmscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_gmscandata xnat_gmscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmscandata
    ADD CONSTRAINT xnat_gmscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_gmsessiondata xnat_gmsessiondata_gmsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmsessiondata
    ADD CONSTRAINT xnat_gmsessiondata_gmsessiondata_info_fkey FOREIGN KEY (gmsessiondata_info) REFERENCES public.xnat_gmsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_gmsessiondata xnat_gmsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmsessiondata
    ADD CONSTRAINT xnat_gmsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_gmsessiondata_meta_data xnat_gmsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmsessiondata_meta_data
    ADD CONSTRAINT xnat_gmsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_gmsessiondata_meta_data xnat_gmsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmsessiondata_meta_data
    ADD CONSTRAINT xnat_gmsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_gmvscandata xnat_gmvscandata_gmvscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmvscandata
    ADD CONSTRAINT xnat_gmvscandata_gmvscandata_info_fkey FOREIGN KEY (gmvscandata_info) REFERENCES public.xnat_gmvscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_gmvscandata_meta_data xnat_gmvscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmvscandata_meta_data
    ADD CONSTRAINT xnat_gmvscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_gmvscandata_meta_data xnat_gmvscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmvscandata_meta_data
    ADD CONSTRAINT xnat_gmvscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_gmvscandata xnat_gmvscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmvscandata
    ADD CONSTRAINT xnat_gmvscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_gmvsessiondata xnat_gmvsessiondata_gmvsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmvsessiondata
    ADD CONSTRAINT xnat_gmvsessiondata_gmvsessiondata_info_fkey FOREIGN KEY (gmvsessiondata_info) REFERENCES public.xnat_gmvsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_gmvsessiondata xnat_gmvsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmvsessiondata
    ADD CONSTRAINT xnat_gmvsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_gmvsessiondata_meta_data xnat_gmvsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmvsessiondata_meta_data
    ADD CONSTRAINT xnat_gmvsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_gmvsessiondata_meta_data xnat_gmvsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_gmvsessiondata_meta_data
    ADD CONSTRAINT xnat_gmvsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_hdscandata xnat_hdscandata_hdscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_hdscandata
    ADD CONSTRAINT xnat_hdscandata_hdscandata_info_fkey FOREIGN KEY (hdscandata_info) REFERENCES public.xnat_hdscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_hdscandata_meta_data xnat_hdscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_hdscandata_meta_data
    ADD CONSTRAINT xnat_hdscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_hdscandata_meta_data xnat_hdscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_hdscandata_meta_data
    ADD CONSTRAINT xnat_hdscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_hdscandata xnat_hdscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_hdscandata
    ADD CONSTRAINT xnat_hdscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_hdsessiondata xnat_hdsessiondata_hdsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_hdsessiondata
    ADD CONSTRAINT xnat_hdsessiondata_hdsessiondata_info_fkey FOREIGN KEY (hdsessiondata_info) REFERENCES public.xnat_hdsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_hdsessiondata xnat_hdsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_hdsessiondata
    ADD CONSTRAINT xnat_hdsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_hdsessiondata_meta_data xnat_hdsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_hdsessiondata_meta_data
    ADD CONSTRAINT xnat_hdsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_hdsessiondata_meta_data xnat_hdsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_hdsessiondata_meta_data
    ADD CONSTRAINT xnat_hdsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imageassessordata xnat_imageassessordata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imageassessordata
    ADD CONSTRAINT xnat_imageassessordata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_deriveddata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_imageassessordata xnat_imageassessordata_imageassessordata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imageassessordata
    ADD CONSTRAINT xnat_imageassessordata_imageassessordata_info_fkey FOREIGN KEY (imageassessordata_info) REFERENCES public.xnat_imageassessordata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imageassessordata xnat_imageassessordata_imagesession_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imageassessordata
    ADD CONSTRAINT xnat_imageassessordata_imagesession_id_fkey FOREIGN KEY (imagesession_id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imageassessordata_meta_data xnat_imageassessordata_meta_d_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imageassessordata_meta_data
    ADD CONSTRAINT xnat_imageassessordata_meta_d_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imageassessordata_meta_data xnat_imageassessordata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imageassessordata_meta_data
    ADD CONSTRAINT xnat_imageassessordata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imageresource xnat_imageresource_imageresource_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imageresource
    ADD CONSTRAINT xnat_imageresource_imageresource_info_fkey FOREIGN KEY (imageresource_info) REFERENCES public.xnat_imageresource_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imageresource_meta_data xnat_imageresource_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imageresource_meta_data
    ADD CONSTRAINT xnat_imageresource_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imageresource_meta_data xnat_imageresource_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imageresource_meta_data
    ADD CONSTRAINT xnat_imageresource_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imageresource xnat_imageresource_xnat_abstractresource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imageresource
    ADD CONSTRAINT xnat_imageresource_xnat_abstractresource_id_fkey FOREIGN KEY (xnat_abstractresource_id) REFERENCES public.xnat_resource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_imageresourceseries xnat_imageresourceseries_imageresourceseries_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imageresourceseries
    ADD CONSTRAINT xnat_imageresourceseries_imageresourceseries_info_fkey FOREIGN KEY (imageresourceseries_info) REFERENCES public.xnat_imageresourceseries_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imageresourceseries_meta_data xnat_imageresourceseries_meta_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imageresourceseries_meta_data
    ADD CONSTRAINT xnat_imageresourceseries_meta_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imageresourceseries_meta_data xnat_imageresourceseries_meta_dat_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imageresourceseries_meta_data
    ADD CONSTRAINT xnat_imageresourceseries_meta_dat_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imageresourceseries xnat_imageresourceseries_xnat_abstractresource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imageresourceseries
    ADD CONSTRAINT xnat_imageresourceseries_xnat_abstractresource_id_fkey FOREIGN KEY (xnat_abstractresource_id) REFERENCES public.xnat_resourceseries(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_imagescandata xnat_imagescandata_extension_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagescandata
    ADD CONSTRAINT xnat_imagescandata_extension_fkey FOREIGN KEY (extension) REFERENCES public.xdat_meta_element(xdat_meta_element_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imagescandata xnat_imagescandata_image_session_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagescandata
    ADD CONSTRAINT xnat_imagescandata_image_session_id_fkey FOREIGN KEY (image_session_id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imagescandata xnat_imagescandata_imagescandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagescandata
    ADD CONSTRAINT xnat_imagescandata_imagescandata_info_fkey FOREIGN KEY (imagescandata_info) REFERENCES public.xnat_imagescandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imagescandata_meta_data xnat_imagescandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagescandata_meta_data
    ADD CONSTRAINT xnat_imagescandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imagescandata_meta_data xnat_imagescandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagescandata_meta_data
    ADD CONSTRAINT xnat_imagescandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imagescandata_share xnat_imagescandata_share_imagescandata_share_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagescandata_share
    ADD CONSTRAINT xnat_imagescandata_share_imagescandata_share_info_fkey FOREIGN KEY (imagescandata_share_info) REFERENCES public.xnat_imagescandata_share_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imagescandata_share_meta_data xnat_imagescandata_share_meta_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagescandata_share_meta_data
    ADD CONSTRAINT xnat_imagescandata_share_meta_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imagescandata_share_meta_data xnat_imagescandata_share_meta_dat_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagescandata_share_meta_data
    ADD CONSTRAINT xnat_imagescandata_share_meta_dat_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imagescandata_share xnat_imagescandata_share_project_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagescandata_share
    ADD CONSTRAINT xnat_imagescandata_share_project_fkey FOREIGN KEY (project) REFERENCES public.xnat_projectdata(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imagescandata_share xnat_imagescandata_share_sharing_share_xnat_imagescandat_x_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagescandata_share
    ADD CONSTRAINT xnat_imagescandata_share_sharing_share_xnat_imagescandat_x_fkey FOREIGN KEY (sharing_share_xnat_imagescandat_xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_imagescandata xnat_imagescandata_validation_xnat_validationdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagescandata
    ADD CONSTRAINT xnat_imagescandata_validation_xnat_validationdata_id_fkey FOREIGN KEY (validation_xnat_validationdata_id) REFERENCES public.xnat_validationdata(xnat_validationdata_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imagesessiondata xnat_imagesessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagesessiondata
    ADD CONSTRAINT xnat_imagesessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_subjectassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_imagesessiondata xnat_imagesessiondata_imagesessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagesessiondata
    ADD CONSTRAINT xnat_imagesessiondata_imagesessiondata_info_fkey FOREIGN KEY (imagesessiondata_info) REFERENCES public.xnat_imagesessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imagesessiondata_meta_data xnat_imagesessiondata_meta_da_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagesessiondata_meta_data
    ADD CONSTRAINT xnat_imagesessiondata_meta_da_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_imagesessiondata_meta_data xnat_imagesessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_imagesessiondata_meta_data
    ADD CONSTRAINT xnat_imagesessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_investigatordata xnat_investigatordata_investigatordata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_investigatordata
    ADD CONSTRAINT xnat_investigatordata_investigatordata_info_fkey FOREIGN KEY (investigatordata_info) REFERENCES public.xnat_investigatordata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_investigatordata_meta_data xnat_investigatordata_meta_da_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_investigatordata_meta_data
    ADD CONSTRAINT xnat_investigatordata_meta_da_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_investigatordata_meta_data xnat_investigatordata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_investigatordata_meta_data
    ADD CONSTRAINT xnat_investigatordata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ioscandata xnat_ioscandata_ioscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ioscandata
    ADD CONSTRAINT xnat_ioscandata_ioscandata_info_fkey FOREIGN KEY (ioscandata_info) REFERENCES public.xnat_ioscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ioscandata_meta_data xnat_ioscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ioscandata_meta_data
    ADD CONSTRAINT xnat_ioscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ioscandata_meta_data xnat_ioscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ioscandata_meta_data
    ADD CONSTRAINT xnat_ioscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ioscandata xnat_ioscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ioscandata
    ADD CONSTRAINT xnat_ioscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_iosessiondata xnat_iosessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_iosessiondata
    ADD CONSTRAINT xnat_iosessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_iosessiondata xnat_iosessiondata_iosessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_iosessiondata
    ADD CONSTRAINT xnat_iosessiondata_iosessiondata_info_fkey FOREIGN KEY (iosessiondata_info) REFERENCES public.xnat_iosessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_iosessiondata_meta_data xnat_iosessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_iosessiondata_meta_data
    ADD CONSTRAINT xnat_iosessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_iosessiondata_meta_data xnat_iosessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_iosessiondata_meta_data
    ADD CONSTRAINT xnat_iosessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_megscandata xnat_megscandata_megscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_megscandata
    ADD CONSTRAINT xnat_megscandata_megscandata_info_fkey FOREIGN KEY (megscandata_info) REFERENCES public.xnat_megscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_megscandata_meta_data xnat_megscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_megscandata_meta_data
    ADD CONSTRAINT xnat_megscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_megscandata_meta_data xnat_megscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_megscandata_meta_data
    ADD CONSTRAINT xnat_megscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_megscandata xnat_megscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_megscandata
    ADD CONSTRAINT xnat_megscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_megsessiondata xnat_megsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_megsessiondata
    ADD CONSTRAINT xnat_megsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_megsessiondata xnat_megsessiondata_megsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_megsessiondata
    ADD CONSTRAINT xnat_megsessiondata_megsessiondata_info_fkey FOREIGN KEY (megsessiondata_info) REFERENCES public.xnat_megsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_megsessiondata_meta_data xnat_megsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_megsessiondata_meta_data
    ADD CONSTRAINT xnat_megsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_megsessiondata_meta_data xnat_megsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_megsessiondata_meta_data
    ADD CONSTRAINT xnat_megsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mgscandata_meta_data xnat_mgscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mgscandata_meta_data
    ADD CONSTRAINT xnat_mgscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mgscandata_meta_data xnat_mgscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mgscandata_meta_data
    ADD CONSTRAINT xnat_mgscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mgscandata xnat_mgscandata_mgscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mgscandata
    ADD CONSTRAINT xnat_mgscandata_mgscandata_info_fkey FOREIGN KEY (mgscandata_info) REFERENCES public.xnat_mgscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mgscandata xnat_mgscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mgscandata
    ADD CONSTRAINT xnat_mgscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_mgsessiondata xnat_mgsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mgsessiondata
    ADD CONSTRAINT xnat_mgsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_mgsessiondata_meta_data xnat_mgsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mgsessiondata_meta_data
    ADD CONSTRAINT xnat_mgsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mgsessiondata_meta_data xnat_mgsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mgsessiondata_meta_data
    ADD CONSTRAINT xnat_mgsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mgsessiondata xnat_mgsessiondata_mgsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mgsessiondata
    ADD CONSTRAINT xnat_mgsessiondata_mgsessiondata_info_fkey FOREIGN KEY (mgsessiondata_info) REFERENCES public.xnat_mgsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrassessordata xnat_mrassessordata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrassessordata
    ADD CONSTRAINT xnat_mrassessordata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imageassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_mrassessordata_meta_data xnat_mrassessordata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrassessordata_meta_data
    ADD CONSTRAINT xnat_mrassessordata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrassessordata_meta_data xnat_mrassessordata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrassessordata_meta_data
    ADD CONSTRAINT xnat_mrassessordata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrassessordata xnat_mrassessordata_mrassessordata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrassessordata
    ADD CONSTRAINT xnat_mrassessordata_mrassessordata_info_fkey FOREIGN KEY (mrassessordata_info) REFERENCES public.xnat_mrassessordata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrqcscandata_meta_data xnat_mrqcscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrqcscandata_meta_data
    ADD CONSTRAINT xnat_mrqcscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrqcscandata_meta_data xnat_mrqcscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrqcscandata_meta_data
    ADD CONSTRAINT xnat_mrqcscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrqcscandata xnat_mrqcscandata_mrqcscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrqcscandata
    ADD CONSTRAINT xnat_mrqcscandata_mrqcscandata_info_fkey FOREIGN KEY (mrqcscandata_info) REFERENCES public.xnat_mrqcscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrqcscandata xnat_mrqcscandata_xnat_qcscandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrqcscandata
    ADD CONSTRAINT xnat_mrqcscandata_xnat_qcscandata_id_fkey FOREIGN KEY (xnat_qcscandata_id) REFERENCES public.xnat_qcscandata(xnat_qcscandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_mrscandata_meta_data xnat_mrscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrscandata_meta_data
    ADD CONSTRAINT xnat_mrscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrscandata_meta_data xnat_mrscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrscandata_meta_data
    ADD CONSTRAINT xnat_mrscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrscandata xnat_mrscandata_mrscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrscandata
    ADD CONSTRAINT xnat_mrscandata_mrscandata_info_fkey FOREIGN KEY (mrscandata_info) REFERENCES public.xnat_mrscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrscandata xnat_mrscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrscandata
    ADD CONSTRAINT xnat_mrscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_mrsessiondata xnat_mrsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrsessiondata
    ADD CONSTRAINT xnat_mrsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_mrsessiondata_meta_data xnat_mrsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrsessiondata_meta_data
    ADD CONSTRAINT xnat_mrsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrsessiondata_meta_data xnat_mrsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrsessiondata_meta_data
    ADD CONSTRAINT xnat_mrsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrsessiondata xnat_mrsessiondata_mrsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrsessiondata
    ADD CONSTRAINT xnat_mrsessiondata_mrsessiondata_info_fkey FOREIGN KEY (mrsessiondata_info) REFERENCES public.xnat_mrsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrsscandata_meta_data xnat_mrsscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrsscandata_meta_data
    ADD CONSTRAINT xnat_mrsscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrsscandata_meta_data xnat_mrsscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrsscandata_meta_data
    ADD CONSTRAINT xnat_mrsscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrsscandata xnat_mrsscandata_mrsscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrsscandata
    ADD CONSTRAINT xnat_mrsscandata_mrsscandata_info_fkey FOREIGN KEY (mrsscandata_info) REFERENCES public.xnat_mrsscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_mrsscandata xnat_mrsscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_mrsscandata
    ADD CONSTRAINT xnat_mrsscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_nmscandata_meta_data xnat_nmscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_nmscandata_meta_data
    ADD CONSTRAINT xnat_nmscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_nmscandata_meta_data xnat_nmscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_nmscandata_meta_data
    ADD CONSTRAINT xnat_nmscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_nmscandata xnat_nmscandata_nmscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_nmscandata
    ADD CONSTRAINT xnat_nmscandata_nmscandata_info_fkey FOREIGN KEY (nmscandata_info) REFERENCES public.xnat_nmscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_nmscandata xnat_nmscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_nmscandata
    ADD CONSTRAINT xnat_nmscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_nmsessiondata xnat_nmsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_nmsessiondata
    ADD CONSTRAINT xnat_nmsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_nmsessiondata_meta_data xnat_nmsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_nmsessiondata_meta_data
    ADD CONSTRAINT xnat_nmsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_nmsessiondata_meta_data xnat_nmsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_nmsessiondata_meta_data
    ADD CONSTRAINT xnat_nmsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_nmsessiondata xnat_nmsessiondata_nmsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_nmsessiondata
    ADD CONSTRAINT xnat_nmsessiondata_nmsessiondata_info_fkey FOREIGN KEY (nmsessiondata_info) REFERENCES public.xnat_nmsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_opscandata_meta_data xnat_opscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_opscandata_meta_data
    ADD CONSTRAINT xnat_opscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_opscandata_meta_data xnat_opscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_opscandata_meta_data
    ADD CONSTRAINT xnat_opscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_opscandata xnat_opscandata_opscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_opscandata
    ADD CONSTRAINT xnat_opscandata_opscandata_info_fkey FOREIGN KEY (opscandata_info) REFERENCES public.xnat_opscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_opscandata xnat_opscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_opscandata
    ADD CONSTRAINT xnat_opscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_opsessiondata xnat_opsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_opsessiondata
    ADD CONSTRAINT xnat_opsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_opsessiondata_meta_data xnat_opsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_opsessiondata_meta_data
    ADD CONSTRAINT xnat_opsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_opsessiondata_meta_data xnat_opsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_opsessiondata_meta_data
    ADD CONSTRAINT xnat_opsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_opsessiondata xnat_opsessiondata_opsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_opsessiondata
    ADD CONSTRAINT xnat_opsessiondata_opsessiondata_info_fkey FOREIGN KEY (opsessiondata_info) REFERENCES public.xnat_opsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_optscandata_meta_data xnat_optscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_optscandata_meta_data
    ADD CONSTRAINT xnat_optscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_optscandata_meta_data xnat_optscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_optscandata_meta_data
    ADD CONSTRAINT xnat_optscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_optscandata xnat_optscandata_optscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_optscandata
    ADD CONSTRAINT xnat_optscandata_optscandata_info_fkey FOREIGN KEY (optscandata_info) REFERENCES public.xnat_optscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_optscandata xnat_optscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_optscandata
    ADD CONSTRAINT xnat_optscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_optsessiondata xnat_optsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_optsessiondata
    ADD CONSTRAINT xnat_optsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_optsessiondata_meta_data xnat_optsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_optsessiondata_meta_data
    ADD CONSTRAINT xnat_optsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_optsessiondata_meta_data xnat_optsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_optsessiondata_meta_data
    ADD CONSTRAINT xnat_optsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_optsessiondata xnat_optsessiondata_optsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_optsessiondata
    ADD CONSTRAINT xnat_optsessiondata_optsessiondata_info_fkey FOREIGN KEY (optsessiondata_info) REFERENCES public.xnat_optsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_otherdicomscandata_meta_data xnat_otherdicomscandata_meta__activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_otherdicomscandata_meta_data
    ADD CONSTRAINT xnat_otherdicomscandata_meta__activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_otherdicomscandata_meta_data xnat_otherdicomscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_otherdicomscandata_meta_data
    ADD CONSTRAINT xnat_otherdicomscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_otherdicomscandata xnat_otherdicomscandata_otherdicomscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_otherdicomscandata
    ADD CONSTRAINT xnat_otherdicomscandata_otherdicomscandata_info_fkey FOREIGN KEY (otherdicomscandata_info) REFERENCES public.xnat_otherdicomscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_otherdicomscandata xnat_otherdicomscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_otherdicomscandata
    ADD CONSTRAINT xnat_otherdicomscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_otherdicomsessiondata xnat_otherdicomsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_otherdicomsessiondata
    ADD CONSTRAINT xnat_otherdicomsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_otherdicomsessiondata_meta_data xnat_otherdicomsessiondata_me_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_otherdicomsessiondata_meta_data
    ADD CONSTRAINT xnat_otherdicomsessiondata_me_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_otherdicomsessiondata_meta_data xnat_otherdicomsessiondata_meta_d_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_otherdicomsessiondata_meta_data
    ADD CONSTRAINT xnat_otherdicomsessiondata_meta_d_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_otherdicomsessiondata xnat_otherdicomsessiondata_otherdicomsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_otherdicomsessiondata
    ADD CONSTRAINT xnat_otherdicomsessiondata_otherdicomsessiondata_info_fkey FOREIGN KEY (otherdicomsessiondata_info) REFERENCES public.xnat_otherdicomsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_otherqcscandata_meta_data xnat_otherqcscandata_meta_dat_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_otherqcscandata_meta_data
    ADD CONSTRAINT xnat_otherqcscandata_meta_dat_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_otherqcscandata_meta_data xnat_otherqcscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_otherqcscandata_meta_data
    ADD CONSTRAINT xnat_otherqcscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_otherqcscandata xnat_otherqcscandata_otherqcscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_otherqcscandata
    ADD CONSTRAINT xnat_otherqcscandata_otherqcscandata_info_fkey FOREIGN KEY (otherqcscandata_info) REFERENCES public.xnat_otherqcscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_otherqcscandata xnat_otherqcscandata_xnat_qcscandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_otherqcscandata
    ADD CONSTRAINT xnat_otherqcscandata_xnat_qcscandata_id_fkey FOREIGN KEY (xnat_qcscandata_id) REFERENCES public.xnat_qcscandata(xnat_qcscandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_petassessordata xnat_petassessordata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petassessordata
    ADD CONSTRAINT xnat_petassessordata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imageassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_petassessordata_meta_data xnat_petassessordata_meta_dat_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petassessordata_meta_data
    ADD CONSTRAINT xnat_petassessordata_meta_dat_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petassessordata_meta_data xnat_petassessordata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petassessordata_meta_data
    ADD CONSTRAINT xnat_petassessordata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petassessordata xnat_petassessordata_petassessordata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petassessordata
    ADD CONSTRAINT xnat_petassessordata_petassessordata_info_fkey FOREIGN KEY (petassessordata_info) REFERENCES public.xnat_petassessordata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petmrsessiondata xnat_petmrsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petmrsessiondata
    ADD CONSTRAINT xnat_petmrsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_petmrsessiondata_meta_data xnat_petmrsessiondata_meta_da_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petmrsessiondata_meta_data
    ADD CONSTRAINT xnat_petmrsessiondata_meta_da_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petmrsessiondata_meta_data xnat_petmrsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petmrsessiondata_meta_data
    ADD CONSTRAINT xnat_petmrsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petmrsessiondata xnat_petmrsessiondata_petmrsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petmrsessiondata
    ADD CONSTRAINT xnat_petmrsessiondata_petmrsessiondata_info_fkey FOREIGN KEY (petmrsessiondata_info) REFERENCES public.xnat_petmrsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petqcscandata_meta_data xnat_petqcscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petqcscandata_meta_data
    ADD CONSTRAINT xnat_petqcscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petqcscandata_meta_data xnat_petqcscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petqcscandata_meta_data
    ADD CONSTRAINT xnat_petqcscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petqcscandata xnat_petqcscandata_petqcscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petqcscandata
    ADD CONSTRAINT xnat_petqcscandata_petqcscandata_info_fkey FOREIGN KEY (petqcscandata_info) REFERENCES public.xnat_petqcscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petqcscandata_processingerror_meta_data xnat_petqcscandata_processing_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petqcscandata_processingerror_meta_data
    ADD CONSTRAINT xnat_petqcscandata_processing_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petqcscandata_processingerror xnat_petqcscandata_processing_petqcscandata_processingerro_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petqcscandata_processingerror
    ADD CONSTRAINT xnat_petqcscandata_processing_petqcscandata_processingerro_fkey FOREIGN KEY (petqcscandata_processingerror_info) REFERENCES public.xnat_petqcscandata_processingerror_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petqcscandata_processingerror xnat_petqcscandata_processing_processingerrors_processinge_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petqcscandata_processingerror
    ADD CONSTRAINT xnat_petqcscandata_processing_processingerrors_processinge_fkey FOREIGN KEY (processingerrors_processingerro_xnat_qcscandata_id) REFERENCES public.xnat_petqcscandata(xnat_qcscandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_petqcscandata_processingerror_meta_data xnat_petqcscandata_processingerro_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petqcscandata_processingerror_meta_data
    ADD CONSTRAINT xnat_petqcscandata_processingerro_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petqcscandata xnat_petqcscandata_xnat_qcscandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petqcscandata
    ADD CONSTRAINT xnat_petqcscandata_xnat_qcscandata_id_fkey FOREIGN KEY (xnat_qcscandata_id) REFERENCES public.xnat_qcscandata(xnat_qcscandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_petscandata_frame_meta_data xnat_petscandata_frame_meta_d_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petscandata_frame_meta_data
    ADD CONSTRAINT xnat_petscandata_frame_meta_d_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petscandata_frame_meta_data xnat_petscandata_frame_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petscandata_frame_meta_data
    ADD CONSTRAINT xnat_petscandata_frame_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petscandata_frame xnat_petscandata_frame_parameters_frames_frame_xnat_pe_xna_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petscandata_frame
    ADD CONSTRAINT xnat_petscandata_frame_parameters_frames_frame_xnat_pe_xna_fkey FOREIGN KEY (parameters_frames_frame_xnat_pe_xnat_imagescandata_id) REFERENCES public.xnat_petscandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_petscandata_frame xnat_petscandata_frame_petscandata_frame_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petscandata_frame
    ADD CONSTRAINT xnat_petscandata_frame_petscandata_frame_info_fkey FOREIGN KEY (petscandata_frame_info) REFERENCES public.xnat_petscandata_frame_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petscandata_meta_data xnat_petscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petscandata_meta_data
    ADD CONSTRAINT xnat_petscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petscandata_meta_data xnat_petscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petscandata_meta_data
    ADD CONSTRAINT xnat_petscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petscandata xnat_petscandata_petscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petscandata
    ADD CONSTRAINT xnat_petscandata_petscandata_info_fkey FOREIGN KEY (petscandata_info) REFERENCES public.xnat_petscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petscandata xnat_petscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petscandata
    ADD CONSTRAINT xnat_petscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_petsessiondata xnat_petsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petsessiondata
    ADD CONSTRAINT xnat_petsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_petsessiondata_meta_data xnat_petsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petsessiondata_meta_data
    ADD CONSTRAINT xnat_petsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petsessiondata_meta_data xnat_petsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petsessiondata_meta_data
    ADD CONSTRAINT xnat_petsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_petsessiondata xnat_petsessiondata_petsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_petsessiondata
    ADD CONSTRAINT xnat_petsessiondata_petsessiondata_info_fkey FOREIGN KEY (petsessiondata_info) REFERENCES public.xnat_petsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectdata_alias xnat_projectdata_alias_aliases_alias_xnat_projectdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_alias
    ADD CONSTRAINT xnat_projectdata_alias_aliases_alias_xnat_projectdata_id_fkey FOREIGN KEY (aliases_alias_xnat_projectdata_id) REFERENCES public.xnat_projectdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_projectdata_alias_meta_data xnat_projectdata_alias_meta_d_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_alias_meta_data
    ADD CONSTRAINT xnat_projectdata_alias_meta_d_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectdata_alias_meta_data xnat_projectdata_alias_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_alias_meta_data
    ADD CONSTRAINT xnat_projectdata_alias_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectdata_alias xnat_projectdata_alias_projectdata_alias_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_alias
    ADD CONSTRAINT xnat_projectdata_alias_projectdata_alias_info_fkey FOREIGN KEY (projectdata_alias_info) REFERENCES public.xnat_projectdata_alias_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectdata_field xnat_projectdata_field_fields_field_xnat_projectdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_field
    ADD CONSTRAINT xnat_projectdata_field_fields_field_xnat_projectdata_id_fkey FOREIGN KEY (fields_field_xnat_projectdata_id) REFERENCES public.xnat_projectdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_projectdata_field_meta_data xnat_projectdata_field_meta_d_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_field_meta_data
    ADD CONSTRAINT xnat_projectdata_field_meta_d_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectdata_field_meta_data xnat_projectdata_field_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_field_meta_data
    ADD CONSTRAINT xnat_projectdata_field_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectdata_field xnat_projectdata_field_projectdata_field_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_field
    ADD CONSTRAINT xnat_projectdata_field_projectdata_field_info_fkey FOREIGN KEY (projectdata_field_info) REFERENCES public.xnat_projectdata_field_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectdata_investigator xnat_projectdata_investigator_xnat_investigatordata_xnat_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_investigator
    ADD CONSTRAINT xnat_projectdata_investigator_xnat_investigatordata_xnat_i_fkey FOREIGN KEY (xnat_investigatordata_xnat_investigatordata_id) REFERENCES public.xnat_investigatordata(xnat_investigatordata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_projectdata_investigator xnat_projectdata_investigator_xnat_projectdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_investigator
    ADD CONSTRAINT xnat_projectdata_investigator_xnat_projectdata_id_fkey FOREIGN KEY (xnat_projectdata_id) REFERENCES public.xnat_projectdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_projectdata_meta_data xnat_projectdata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_meta_data
    ADD CONSTRAINT xnat_projectdata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectdata_meta_data xnat_projectdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_meta_data
    ADD CONSTRAINT xnat_projectdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectdata xnat_projectdata_pi_xnat_investigatordata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata
    ADD CONSTRAINT xnat_projectdata_pi_xnat_investigatordata_id_fkey FOREIGN KEY (pi_xnat_investigatordata_id) REFERENCES public.xnat_investigatordata(xnat_investigatordata_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectdata xnat_projectdata_projectdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata
    ADD CONSTRAINT xnat_projectdata_projectdata_info_fkey FOREIGN KEY (projectdata_info) REFERENCES public.xnat_projectdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectdata_resource xnat_projectdata_resource_xnat_abstractresource_xnat_abstr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_resource
    ADD CONSTRAINT xnat_projectdata_resource_xnat_abstractresource_xnat_abstr_fkey FOREIGN KEY (xnat_abstractresource_xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_projectdata_resource xnat_projectdata_resource_xnat_projectdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectdata_resource
    ADD CONSTRAINT xnat_projectdata_resource_xnat_projectdata_id_fkey FOREIGN KEY (xnat_projectdata_id) REFERENCES public.xnat_projectdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_projectparticipant_meta_data xnat_projectparticipant_meta__activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectparticipant_meta_data
    ADD CONSTRAINT xnat_projectparticipant_meta__activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectparticipant_meta_data xnat_projectparticipant_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectparticipant_meta_data
    ADD CONSTRAINT xnat_projectparticipant_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectparticipant xnat_projectparticipant_project_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectparticipant
    ADD CONSTRAINT xnat_projectparticipant_project_fkey FOREIGN KEY (project) REFERENCES public.xnat_projectdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_projectparticipant xnat_projectparticipant_projectparticipant_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectparticipant
    ADD CONSTRAINT xnat_projectparticipant_projectparticipant_info_fkey FOREIGN KEY (projectparticipant_info) REFERENCES public.xnat_projectparticipant_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_projectparticipant xnat_projectparticipant_subject_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_projectparticipant
    ADD CONSTRAINT xnat_projectparticipant_subject_id_fkey FOREIGN KEY (subject_id) REFERENCES public.xnat_subjectdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_publicationresource_meta_data xnat_publicationresource_meta_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_publicationresource_meta_data
    ADD CONSTRAINT xnat_publicationresource_meta_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_publicationresource_meta_data xnat_publicationresource_meta_dat_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_publicationresource_meta_data
    ADD CONSTRAINT xnat_publicationresource_meta_dat_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_publicationresource xnat_publicationresource_publicationresource_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_publicationresource
    ADD CONSTRAINT xnat_publicationresource_publicationresource_info_fkey FOREIGN KEY (publicationresource_info) REFERENCES public.xnat_publicationresource_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_publicationresource xnat_publicationresource_publications_publication_xnat_p_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_publicationresource
    ADD CONSTRAINT xnat_publicationresource_publications_publication_xnat_p_i_fkey FOREIGN KEY (publications_publication_xnat_p_id) REFERENCES public.xnat_projectdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_publicationresource xnat_publicationresource_xnat_abstractresource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_publicationresource
    ADD CONSTRAINT xnat_publicationresource_xnat_abstractresource_id_fkey FOREIGN KEY (xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_pvisitdata xnat_pvisitdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_pvisitdata
    ADD CONSTRAINT xnat_pvisitdata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_genericdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_pvisitdata_meta_data xnat_pvisitdata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_pvisitdata_meta_data
    ADD CONSTRAINT xnat_pvisitdata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_pvisitdata_meta_data xnat_pvisitdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_pvisitdata_meta_data
    ADD CONSTRAINT xnat_pvisitdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_pvisitdata xnat_pvisitdata_pvisitdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_pvisitdata
    ADD CONSTRAINT xnat_pvisitdata_pvisitdata_info_fkey FOREIGN KEY (pvisitdata_info) REFERENCES public.xnat_pvisitdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_pvisitdata xnat_pvisitdata_subject_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_pvisitdata
    ADD CONSTRAINT xnat_pvisitdata_subject_id_fkey FOREIGN KEY (subject_id) REFERENCES public.xnat_subjectdata(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcassessmentdata xnat_qcassessmentdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata
    ADD CONSTRAINT xnat_qcassessmentdata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_mrassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_qcassessmentdata_meta_data xnat_qcassessmentdata_meta_da_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata_meta_data
    ADD CONSTRAINT xnat_qcassessmentdata_meta_da_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcassessmentdata_meta_data xnat_qcassessmentdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata_meta_data
    ADD CONSTRAINT xnat_qcassessmentdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcassessmentdata xnat_qcassessmentdata_qcassessmentdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata
    ADD CONSTRAINT xnat_qcassessmentdata_qcassessmentdata_info_fkey FOREIGN KEY (qcassessmentdata_info) REFERENCES public.xnat_qcassessmentdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcassessmentdata_scan_meta_data xnat_qcassessmentdata_scan_me_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata_scan_meta_data
    ADD CONSTRAINT xnat_qcassessmentdata_scan_me_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcassessmentdata_scan_meta_data xnat_qcassessmentdata_scan_meta_d_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata_scan_meta_data
    ADD CONSTRAINT xnat_qcassessmentdata_scan_meta_d_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcassessmentdata_scan xnat_qcassessmentdata_scan_qcassessmentdata_scan_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata_scan
    ADD CONSTRAINT xnat_qcassessmentdata_scan_qcassessmentdata_scan_info_fkey FOREIGN KEY (qcassessmentdata_scan_info) REFERENCES public.xnat_qcassessmentdata_scan_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcassessmentdata_scan xnat_qcassessmentdata_scan_scans_scan_xnat_qcassessmentdat_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata_scan
    ADD CONSTRAINT xnat_qcassessmentdata_scan_scans_scan_xnat_qcassessmentdat_fkey FOREIGN KEY (scans_scan_xnat_qcassessmentdat_id) REFERENCES public.xnat_qcassessmentdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_qcassessmentdata_scan xnat_qcassessmentdata_scan_scanstatistics_xnat_abstractsta_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata_scan
    ADD CONSTRAINT xnat_qcassessmentdata_scan_scanstatistics_xnat_abstractsta_fkey FOREIGN KEY (scanstatistics_xnat_abstractstatistics_id) REFERENCES public.xnat_abstractstatistics(xnat_abstractstatistics_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcassessmentdata_scan_slice_meta_data xnat_qcassessmentdata_scan_sl_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata_scan_slice_meta_data
    ADD CONSTRAINT xnat_qcassessmentdata_scan_sl_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcassessmentdata_scan_slice xnat_qcassessmentdata_scan_sl_qcassessmentdata_scan_slice__fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata_scan_slice
    ADD CONSTRAINT xnat_qcassessmentdata_scan_sl_qcassessmentdata_scan_slice__fkey FOREIGN KEY (qcassessmentdata_scan_slice_info) REFERENCES public.xnat_qcassessmentdata_scan_slice_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcassessmentdata_scan_slice xnat_qcassessmentdata_scan_sl_sliceqc_slice_xnat_qcassessm_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata_scan_slice
    ADD CONSTRAINT xnat_qcassessmentdata_scan_sl_sliceqc_slice_xnat_qcassessm_fkey FOREIGN KEY (sliceqc_slice_xnat_qcassessment_xnat_qcassessmentdata_scan_id) REFERENCES public.xnat_qcassessmentdata_scan(xnat_qcassessmentdata_scan_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_qcassessmentdata_scan_slice xnat_qcassessmentdata_scan_sl_slicestatistics_xnat_abstrac_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata_scan_slice
    ADD CONSTRAINT xnat_qcassessmentdata_scan_sl_slicestatistics_xnat_abstrac_fkey FOREIGN KEY (slicestatistics_xnat_abstractstatistics_id) REFERENCES public.xnat_abstractstatistics(xnat_abstractstatistics_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcassessmentdata_scan_slice_meta_data xnat_qcassessmentdata_scan_slice__insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcassessmentdata_scan_slice_meta_data
    ADD CONSTRAINT xnat_qcassessmentdata_scan_slice__insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcmanualassessordata xnat_qcmanualassessordata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcmanualassessordata
    ADD CONSTRAINT xnat_qcmanualassessordata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imageassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_qcmanualassessordata_meta_data xnat_qcmanualassessordata_met_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcmanualassessordata_meta_data
    ADD CONSTRAINT xnat_qcmanualassessordata_met_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcmanualassessordata_meta_data xnat_qcmanualassessordata_meta_da_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcmanualassessordata_meta_data
    ADD CONSTRAINT xnat_qcmanualassessordata_meta_da_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcmanualassessordata xnat_qcmanualassessordata_qcmanualassessordata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcmanualassessordata
    ADD CONSTRAINT xnat_qcmanualassessordata_qcmanualassessordata_info_fkey FOREIGN KEY (qcmanualassessordata_info) REFERENCES public.xnat_qcmanualassessordata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcscandata xnat_qcscandata_extension_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcscandata
    ADD CONSTRAINT xnat_qcscandata_extension_fkey FOREIGN KEY (extension) REFERENCES public.xdat_meta_element(xdat_meta_element_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcscandata_field xnat_qcscandata_field_fields_field_xnat_qcscandata_xnat_qc_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcscandata_field
    ADD CONSTRAINT xnat_qcscandata_field_fields_field_xnat_qcscandata_xnat_qc_fkey FOREIGN KEY (fields_field_xnat_qcscandata_xnat_qcscandata_id) REFERENCES public.xnat_qcscandata(xnat_qcscandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_qcscandata_field_meta_data xnat_qcscandata_field_meta_da_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcscandata_field_meta_data
    ADD CONSTRAINT xnat_qcscandata_field_meta_da_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcscandata_field_meta_data xnat_qcscandata_field_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcscandata_field_meta_data
    ADD CONSTRAINT xnat_qcscandata_field_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcscandata_field xnat_qcscandata_field_qcscandata_field_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcscandata_field
    ADD CONSTRAINT xnat_qcscandata_field_qcscandata_field_info_fkey FOREIGN KEY (qcscandata_field_info) REFERENCES public.xnat_qcscandata_field_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcscandata_meta_data xnat_qcscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcscandata_meta_data
    ADD CONSTRAINT xnat_qcscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcscandata_meta_data xnat_qcscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcscandata_meta_data
    ADD CONSTRAINT xnat_qcscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcscandata xnat_qcscandata_qcscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcscandata
    ADD CONSTRAINT xnat_qcscandata_qcscandata_info_fkey FOREIGN KEY (qcscandata_info) REFERENCES public.xnat_qcscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_qcscandata xnat_qcscandata_scans_scan_xnat_qcmanualassesso_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_qcscandata
    ADD CONSTRAINT xnat_qcscandata_scans_scan_xnat_qcmanualassesso_id_fkey FOREIGN KEY (scans_scan_xnat_qcmanualassesso_id) REFERENCES public.xnat_qcmanualassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_reconstructedimagedata xnat_reconstructedimagedata_image_session_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_reconstructedimagedata
    ADD CONSTRAINT xnat_reconstructedimagedata_image_session_id_fkey FOREIGN KEY (image_session_id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_reconstructedimagedata_meta_data xnat_reconstructedimagedata_m_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_reconstructedimagedata_meta_data
    ADD CONSTRAINT xnat_reconstructedimagedata_m_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_reconstructedimagedata_meta_data xnat_reconstructedimagedata_meta__insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_reconstructedimagedata_meta_data
    ADD CONSTRAINT xnat_reconstructedimagedata_meta__insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_reconstructedimagedata xnat_reconstructedimagedata_provenance_prov_process_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_reconstructedimagedata
    ADD CONSTRAINT xnat_reconstructedimagedata_provenance_prov_process_id_fkey FOREIGN KEY (provenance_prov_process_id) REFERENCES public.prov_process(prov_process_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_reconstructedimagedata xnat_reconstructedimagedata_reconstructedimagedata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_reconstructedimagedata
    ADD CONSTRAINT xnat_reconstructedimagedata_reconstructedimagedata_info_fkey FOREIGN KEY (reconstructedimagedata_info) REFERENCES public.xnat_reconstructedimagedata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_reconstructedimagedata_scanid_meta_data xnat_reconstructedimagedata_s_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_reconstructedimagedata_scanid_meta_data
    ADD CONSTRAINT xnat_reconstructedimagedata_s_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_reconstructedimagedata_scanid xnat_reconstructedimagedata_s_inscans_scanid_xnat_reconstr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_reconstructedimagedata_scanid
    ADD CONSTRAINT xnat_reconstructedimagedata_s_inscans_scanid_xnat_reconstr_fkey FOREIGN KEY (inscans_scanid_xnat_reconstruct_xnat_reconstructedimagedata_id) REFERENCES public.xnat_reconstructedimagedata(xnat_reconstructedimagedata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_reconstructedimagedata_scanid xnat_reconstructedimagedata_s_reconstructedimagedata_scani_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_reconstructedimagedata_scanid
    ADD CONSTRAINT xnat_reconstructedimagedata_s_reconstructedimagedata_scani_fkey FOREIGN KEY (reconstructedimagedata_scanid_info) REFERENCES public.xnat_reconstructedimagedata_scanid_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_reconstructedimagedata_scanid_meta_data xnat_reconstructedimagedata_scani_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_reconstructedimagedata_scanid_meta_data
    ADD CONSTRAINT xnat_reconstructedimagedata_scani_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_regionresource xnat_regionresource_baseimage_xnat_abstractresource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_regionresource
    ADD CONSTRAINT xnat_regionresource_baseimage_xnat_abstractresource_id_fkey FOREIGN KEY (baseimage_xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_regionresource xnat_regionresource_file_xnat_abstractresource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_regionresource
    ADD CONSTRAINT xnat_regionresource_file_xnat_abstractresource_id_fkey FOREIGN KEY (file_xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_regionresource_label_meta_data xnat_regionresource_label_met_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_regionresource_label_meta_data
    ADD CONSTRAINT xnat_regionresource_label_met_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_regionresource_label_meta_data xnat_regionresource_label_meta_da_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_regionresource_label_meta_data
    ADD CONSTRAINT xnat_regionresource_label_meta_da_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_regionresource_label xnat_regionresource_label_regionresource_label_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_regionresource_label
    ADD CONSTRAINT xnat_regionresource_label_regionresource_label_info_fkey FOREIGN KEY (regionresource_label_info) REFERENCES public.xnat_regionresource_label_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_regionresource_label xnat_regionresource_label_subregionlabels_label_xnat_regi__fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_regionresource_label
    ADD CONSTRAINT xnat_regionresource_label_subregionlabels_label_xnat_regi__fkey FOREIGN KEY (subregionlabels_label_xnat_regi_xnat_regionresource_id) REFERENCES public.xnat_regionresource(xnat_regionresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_regionresource_meta_data xnat_regionresource_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_regionresource_meta_data
    ADD CONSTRAINT xnat_regionresource_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_regionresource_meta_data xnat_regionresource_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_regionresource_meta_data
    ADD CONSTRAINT xnat_regionresource_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_regionresource xnat_regionresource_regionresource_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_regionresource
    ADD CONSTRAINT xnat_regionresource_regionresource_info_fkey FOREIGN KEY (regionresource_info) REFERENCES public.xnat_regionresource_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_regionresource xnat_regionresource_session_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_regionresource
    ADD CONSTRAINT xnat_regionresource_session_id_fkey FOREIGN KEY (session_id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_resource_meta_data xnat_resource_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_resource_meta_data
    ADD CONSTRAINT xnat_resource_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_resource_meta_data xnat_resource_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_resource_meta_data
    ADD CONSTRAINT xnat_resource_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_resource xnat_resource_provenance_prov_process_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_resource
    ADD CONSTRAINT xnat_resource_provenance_prov_process_id_fkey FOREIGN KEY (provenance_prov_process_id) REFERENCES public.prov_process(prov_process_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_resource xnat_resource_resource_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_resource
    ADD CONSTRAINT xnat_resource_resource_info_fkey FOREIGN KEY (resource_info) REFERENCES public.xnat_resource_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_resource xnat_resource_xnat_abstractresource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_resource
    ADD CONSTRAINT xnat_resource_xnat_abstractresource_id_fkey FOREIGN KEY (xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_resourcecatalog_meta_data xnat_resourcecatalog_meta_dat_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_resourcecatalog_meta_data
    ADD CONSTRAINT xnat_resourcecatalog_meta_dat_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_resourcecatalog_meta_data xnat_resourcecatalog_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_resourcecatalog_meta_data
    ADD CONSTRAINT xnat_resourcecatalog_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_resourcecatalog xnat_resourcecatalog_resourcecatalog_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_resourcecatalog
    ADD CONSTRAINT xnat_resourcecatalog_resourcecatalog_info_fkey FOREIGN KEY (resourcecatalog_info) REFERENCES public.xnat_resourcecatalog_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_resourcecatalog xnat_resourcecatalog_xnat_abstractresource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_resourcecatalog
    ADD CONSTRAINT xnat_resourcecatalog_xnat_abstractresource_id_fkey FOREIGN KEY (xnat_abstractresource_id) REFERENCES public.xnat_resource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_resourceseries_meta_data xnat_resourceseries_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_resourceseries_meta_data
    ADD CONSTRAINT xnat_resourceseries_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_resourceseries_meta_data xnat_resourceseries_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_resourceseries_meta_data
    ADD CONSTRAINT xnat_resourceseries_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_resourceseries xnat_resourceseries_resourceseries_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_resourceseries
    ADD CONSTRAINT xnat_resourceseries_resourceseries_info_fkey FOREIGN KEY (resourceseries_info) REFERENCES public.xnat_resourceseries_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_resourceseries xnat_resourceseries_xnat_abstractresource_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_resourceseries
    ADD CONSTRAINT xnat_resourceseries_xnat_abstractresource_id_fkey FOREIGN KEY (xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_rfscandata_meta_data xnat_rfscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rfscandata_meta_data
    ADD CONSTRAINT xnat_rfscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_rfscandata_meta_data xnat_rfscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rfscandata_meta_data
    ADD CONSTRAINT xnat_rfscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_rfscandata xnat_rfscandata_rfscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rfscandata
    ADD CONSTRAINT xnat_rfscandata_rfscandata_info_fkey FOREIGN KEY (rfscandata_info) REFERENCES public.xnat_rfscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_rfscandata xnat_rfscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rfscandata
    ADD CONSTRAINT xnat_rfscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_rfsessiondata xnat_rfsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rfsessiondata
    ADD CONSTRAINT xnat_rfsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_rfsessiondata_meta_data xnat_rfsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rfsessiondata_meta_data
    ADD CONSTRAINT xnat_rfsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_rfsessiondata_meta_data xnat_rfsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rfsessiondata_meta_data
    ADD CONSTRAINT xnat_rfsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_rfsessiondata xnat_rfsessiondata_rfsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rfsessiondata
    ADD CONSTRAINT xnat_rfsessiondata_rfsessiondata_info_fkey FOREIGN KEY (rfsessiondata_info) REFERENCES public.xnat_rfsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_rtimagescandata_meta_data xnat_rtimagescandata_meta_dat_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rtimagescandata_meta_data
    ADD CONSTRAINT xnat_rtimagescandata_meta_dat_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_rtimagescandata_meta_data xnat_rtimagescandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rtimagescandata_meta_data
    ADD CONSTRAINT xnat_rtimagescandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_rtimagescandata xnat_rtimagescandata_rtimagescandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rtimagescandata
    ADD CONSTRAINT xnat_rtimagescandata_rtimagescandata_info_fkey FOREIGN KEY (rtimagescandata_info) REFERENCES public.xnat_rtimagescandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_rtimagescandata xnat_rtimagescandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rtimagescandata
    ADD CONSTRAINT xnat_rtimagescandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_rtsessiondata xnat_rtsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rtsessiondata
    ADD CONSTRAINT xnat_rtsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_rtsessiondata_meta_data xnat_rtsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rtsessiondata_meta_data
    ADD CONSTRAINT xnat_rtsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_rtsessiondata_meta_data xnat_rtsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rtsessiondata_meta_data
    ADD CONSTRAINT xnat_rtsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_rtsessiondata xnat_rtsessiondata_rtsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_rtsessiondata
    ADD CONSTRAINT xnat_rtsessiondata_rtsessiondata_info_fkey FOREIGN KEY (rtsessiondata_info) REFERENCES public.xnat_rtsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_scscandata_meta_data xnat_scscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_scscandata_meta_data
    ADD CONSTRAINT xnat_scscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_scscandata_meta_data xnat_scscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_scscandata_meta_data
    ADD CONSTRAINT xnat_scscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_scscandata xnat_scscandata_scscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_scscandata
    ADD CONSTRAINT xnat_scscandata_scscandata_info_fkey FOREIGN KEY (scscandata_info) REFERENCES public.xnat_scscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_scscandata xnat_scscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_scscandata
    ADD CONSTRAINT xnat_scscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_segscandata_meta_data xnat_segscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_segscandata_meta_data
    ADD CONSTRAINT xnat_segscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_segscandata_meta_data xnat_segscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_segscandata_meta_data
    ADD CONSTRAINT xnat_segscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_segscandata xnat_segscandata_segscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_segscandata
    ADD CONSTRAINT xnat_segscandata_segscandata_info_fkey FOREIGN KEY (segscandata_info) REFERENCES public.xnat_segscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_segscandata xnat_segscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_segscandata
    ADD CONSTRAINT xnat_segscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_smscandata_meta_data xnat_smscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_smscandata_meta_data
    ADD CONSTRAINT xnat_smscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_smscandata_meta_data xnat_smscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_smscandata_meta_data
    ADD CONSTRAINT xnat_smscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_smscandata xnat_smscandata_smscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_smscandata
    ADD CONSTRAINT xnat_smscandata_smscandata_info_fkey FOREIGN KEY (smscandata_info) REFERENCES public.xnat_smscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_smscandata xnat_smscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_smscandata
    ADD CONSTRAINT xnat_smscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_smsessiondata xnat_smsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_smsessiondata
    ADD CONSTRAINT xnat_smsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_smsessiondata_meta_data xnat_smsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_smsessiondata_meta_data
    ADD CONSTRAINT xnat_smsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_smsessiondata_meta_data xnat_smsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_smsessiondata_meta_data
    ADD CONSTRAINT xnat_smsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_smsessiondata xnat_smsessiondata_smsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_smsessiondata
    ADD CONSTRAINT xnat_smsessiondata_smsessiondata_info_fkey FOREIGN KEY (smsessiondata_info) REFERENCES public.xnat_smsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_srscandata_meta_data xnat_srscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_srscandata_meta_data
    ADD CONSTRAINT xnat_srscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_srscandata_meta_data xnat_srscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_srscandata_meta_data
    ADD CONSTRAINT xnat_srscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_srscandata xnat_srscandata_srscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_srscandata
    ADD CONSTRAINT xnat_srscandata_srscandata_info_fkey FOREIGN KEY (srscandata_info) REFERENCES public.xnat_srscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_srscandata xnat_srscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_srscandata
    ADD CONSTRAINT xnat_srscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_srsessiondata xnat_srsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_srsessiondata
    ADD CONSTRAINT xnat_srsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_srsessiondata_meta_data xnat_srsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_srsessiondata_meta_data
    ADD CONSTRAINT xnat_srsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_srsessiondata_meta_data xnat_srsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_srsessiondata_meta_data
    ADD CONSTRAINT xnat_srsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_srsessiondata xnat_srsessiondata_srsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_srsessiondata
    ADD CONSTRAINT xnat_srsessiondata_srsessiondata_info_fkey FOREIGN KEY (srsessiondata_info) REFERENCES public.xnat_srsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_statisticsdata_addfield_meta_data xnat_statisticsdata_addfield__activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_statisticsdata_addfield_meta_data
    ADD CONSTRAINT xnat_statisticsdata_addfield__activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_statisticsdata_addfield_meta_data xnat_statisticsdata_addfield_meta_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_statisticsdata_addfield_meta_data
    ADD CONSTRAINT xnat_statisticsdata_addfield_meta_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_statisticsdata_addfield xnat_statisticsdata_addfield_statisticsdata_addfield_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_statisticsdata_addfield
    ADD CONSTRAINT xnat_statisticsdata_addfield_statisticsdata_addfield_info_fkey FOREIGN KEY (statisticsdata_addfield_info) REFERENCES public.xnat_statisticsdata_addfield_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_statisticsdata_addfield xnat_statisticsdata_addfield_xnat_statisticsdata_xnat_abst_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_statisticsdata_addfield
    ADD CONSTRAINT xnat_statisticsdata_addfield_xnat_statisticsdata_xnat_abst_fkey FOREIGN KEY (xnat_statisticsdata_xnat_abstractstatistics_id) REFERENCES public.xnat_statisticsdata(xnat_abstractstatistics_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_statisticsdata_additionalstatistics_meta_data xnat_statisticsdata_additiona_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_statisticsdata_additionalstatistics_meta_data
    ADD CONSTRAINT xnat_statisticsdata_additiona_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_statisticsdata_additionalstatistics xnat_statisticsdata_additiona_statisticsdata_additionalsta_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_statisticsdata_additionalstatistics
    ADD CONSTRAINT xnat_statisticsdata_additiona_statisticsdata_additionalsta_fkey FOREIGN KEY (statisticsdata_additionalstatistics_info) REFERENCES public.xnat_statisticsdata_additionalstatistics_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_statisticsdata_additionalstatistics xnat_statisticsdata_additiona_xnat_statisticsdata_xnat_abs_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_statisticsdata_additionalstatistics
    ADD CONSTRAINT xnat_statisticsdata_additiona_xnat_statisticsdata_xnat_abs_fkey FOREIGN KEY (xnat_statisticsdata_xnat_abstractstatistics_id) REFERENCES public.xnat_statisticsdata(xnat_abstractstatistics_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_statisticsdata_additionalstatistics_meta_data xnat_statisticsdata_additionalsta_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_statisticsdata_additionalstatistics_meta_data
    ADD CONSTRAINT xnat_statisticsdata_additionalsta_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_statisticsdata_meta_data xnat_statisticsdata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_statisticsdata_meta_data
    ADD CONSTRAINT xnat_statisticsdata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_statisticsdata_meta_data xnat_statisticsdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_statisticsdata_meta_data
    ADD CONSTRAINT xnat_statisticsdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_statisticsdata xnat_statisticsdata_statisticsdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_statisticsdata
    ADD CONSTRAINT xnat_statisticsdata_statisticsdata_info_fkey FOREIGN KEY (statisticsdata_info) REFERENCES public.xnat_statisticsdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_statisticsdata xnat_statisticsdata_xnat_abstractstatistics_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_statisticsdata
    ADD CONSTRAINT xnat_statisticsdata_xnat_abstractstatistics_id_fkey FOREIGN KEY (xnat_abstractstatistics_id) REFERENCES public.xnat_abstractstatistics(xnat_abstractstatistics_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_studyprotocol_condition_meta_data xnat_studyprotocol_condition__activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_condition_meta_data
    ADD CONSTRAINT xnat_studyprotocol_condition__activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_condition xnat_studyprotocol_condition_acqconditions_condition_xnat__fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_condition
    ADD CONSTRAINT xnat_studyprotocol_condition_acqconditions_condition_xnat__fkey FOREIGN KEY (acqconditions_condition_xnat_st_xnat_abstractprotocol_id) REFERENCES public.xnat_studyprotocol(xnat_abstractprotocol_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_studyprotocol_condition_meta_data xnat_studyprotocol_condition_meta_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_condition_meta_data
    ADD CONSTRAINT xnat_studyprotocol_condition_meta_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_condition xnat_studyprotocol_condition_studyprotocol_condition_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_condition
    ADD CONSTRAINT xnat_studyprotocol_condition_studyprotocol_condition_info_fkey FOREIGN KEY (studyprotocol_condition_info) REFERENCES public.xnat_studyprotocol_condition_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_group_meta_data xnat_studyprotocol_group_meta_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_group_meta_data
    ADD CONSTRAINT xnat_studyprotocol_group_meta_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_group_meta_data xnat_studyprotocol_group_meta_dat_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_group_meta_data
    ADD CONSTRAINT xnat_studyprotocol_group_meta_dat_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_group xnat_studyprotocol_group_studyprotocol_group_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_group
    ADD CONSTRAINT xnat_studyprotocol_group_studyprotocol_group_info_fkey FOREIGN KEY (studyprotocol_group_info) REFERENCES public.xnat_studyprotocol_group_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_group xnat_studyprotocol_group_subjectgroups_group_xnat_studyp_x_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_group
    ADD CONSTRAINT xnat_studyprotocol_group_subjectgroups_group_xnat_studyp_x_fkey FOREIGN KEY (subjectgroups_group_xnat_studyp_xnat_abstractprotocol_id) REFERENCES public.xnat_studyprotocol(xnat_abstractprotocol_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_studyprotocol_meta_data xnat_studyprotocol_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_meta_data
    ADD CONSTRAINT xnat_studyprotocol_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_meta_data xnat_studyprotocol_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_meta_data
    ADD CONSTRAINT xnat_studyprotocol_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_session xnat_studyprotocol_session_imagesessiontypes_session_xnat__fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_session
    ADD CONSTRAINT xnat_studyprotocol_session_imagesessiontypes_session_xnat__fkey FOREIGN KEY (imagesessiontypes_session_xnat__xnat_abstractprotocol_id) REFERENCES public.xnat_studyprotocol(xnat_abstractprotocol_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_studyprotocol_session_meta_data xnat_studyprotocol_session_me_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_session_meta_data
    ADD CONSTRAINT xnat_studyprotocol_session_me_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_session_meta_data xnat_studyprotocol_session_meta_d_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_session_meta_data
    ADD CONSTRAINT xnat_studyprotocol_session_meta_d_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_session xnat_studyprotocol_session_studyprotocol_session_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_session
    ADD CONSTRAINT xnat_studyprotocol_session_studyprotocol_session_info_fkey FOREIGN KEY (studyprotocol_session_info) REFERENCES public.xnat_studyprotocol_session_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol xnat_studyprotocol_studyprotocol_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol
    ADD CONSTRAINT xnat_studyprotocol_studyprotocol_info_fkey FOREIGN KEY (studyprotocol_info) REFERENCES public.xnat_studyprotocol_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_variable_meta_data xnat_studyprotocol_variable_m_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_variable_meta_data
    ADD CONSTRAINT xnat_studyprotocol_variable_m_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_variable_meta_data xnat_studyprotocol_variable_meta__insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_variable_meta_data
    ADD CONSTRAINT xnat_studyprotocol_variable_meta__insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_variable xnat_studyprotocol_variable_studyprotocol_variable_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_variable
    ADD CONSTRAINT xnat_studyprotocol_variable_studyprotocol_variable_info_fkey FOREIGN KEY (studyprotocol_variable_info) REFERENCES public.xnat_studyprotocol_variable_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_studyprotocol_variable xnat_studyprotocol_variable_subjectvariables_variable_xnat_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol_variable
    ADD CONSTRAINT xnat_studyprotocol_variable_subjectvariables_variable_xnat_fkey FOREIGN KEY (subjectvariables_variable_xnat__xnat_abstractprotocol_id) REFERENCES public.xnat_studyprotocol(xnat_abstractprotocol_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_studyprotocol xnat_studyprotocol_xnat_abstractprotocol_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_studyprotocol
    ADD CONSTRAINT xnat_studyprotocol_xnat_abstractprotocol_id_fkey FOREIGN KEY (xnat_abstractprotocol_id) REFERENCES public.xnat_abstractprotocol(xnat_abstractprotocol_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_subjectassessordata xnat_subjectassessordata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectassessordata
    ADD CONSTRAINT xnat_subjectassessordata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_experimentdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_subjectassessordata_meta_data xnat_subjectassessordata_meta_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectassessordata_meta_data
    ADD CONSTRAINT xnat_subjectassessordata_meta_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectassessordata_meta_data xnat_subjectassessordata_meta_dat_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectassessordata_meta_data
    ADD CONSTRAINT xnat_subjectassessordata_meta_dat_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectassessordata xnat_subjectassessordata_subject_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectassessordata
    ADD CONSTRAINT xnat_subjectassessordata_subject_id_fkey FOREIGN KEY (subject_id) REFERENCES public.xnat_subjectdata(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectassessordata xnat_subjectassessordata_subjectassessordata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectassessordata
    ADD CONSTRAINT xnat_subjectassessordata_subjectassessordata_info_fkey FOREIGN KEY (subjectassessordata_info) REFERENCES public.xnat_subjectassessordata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectdata_addid_meta_data xnat_subjectdata_addid_meta_d_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata_addid_meta_data
    ADD CONSTRAINT xnat_subjectdata_addid_meta_d_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectdata_addid_meta_data xnat_subjectdata_addid_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata_addid_meta_data
    ADD CONSTRAINT xnat_subjectdata_addid_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectdata_addid xnat_subjectdata_addid_subjectdata_addid_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata_addid
    ADD CONSTRAINT xnat_subjectdata_addid_subjectdata_addid_info_fkey FOREIGN KEY (subjectdata_addid_info) REFERENCES public.xnat_subjectdata_addid_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectdata_addid xnat_subjectdata_addid_xnat_subjectdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata_addid
    ADD CONSTRAINT xnat_subjectdata_addid_xnat_subjectdata_id_fkey FOREIGN KEY (xnat_subjectdata_id) REFERENCES public.xnat_subjectdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_subjectdata xnat_subjectdata_demographics_xnat_abstractdemographicdata_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata
    ADD CONSTRAINT xnat_subjectdata_demographics_xnat_abstractdemographicdata_fkey FOREIGN KEY (demographics_xnat_abstractdemographicdata_id) REFERENCES public.xnat_abstractdemographicdata(xnat_abstractdemographicdata_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectdata_field xnat_subjectdata_field_fields_field_xnat_subjectdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata_field
    ADD CONSTRAINT xnat_subjectdata_field_fields_field_xnat_subjectdata_id_fkey FOREIGN KEY (fields_field_xnat_subjectdata_id) REFERENCES public.xnat_subjectdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_subjectdata_field_meta_data xnat_subjectdata_field_meta_d_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata_field_meta_data
    ADD CONSTRAINT xnat_subjectdata_field_meta_d_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectdata_field_meta_data xnat_subjectdata_field_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata_field_meta_data
    ADD CONSTRAINT xnat_subjectdata_field_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectdata_field xnat_subjectdata_field_subjectdata_field_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata_field
    ADD CONSTRAINT xnat_subjectdata_field_subjectdata_field_info_fkey FOREIGN KEY (subjectdata_field_info) REFERENCES public.xnat_subjectdata_field_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectdata xnat_subjectdata_investigator_xnat_investigatordata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata
    ADD CONSTRAINT xnat_subjectdata_investigator_xnat_investigatordata_id_fkey FOREIGN KEY (investigator_xnat_investigatordata_id) REFERENCES public.xnat_investigatordata(xnat_investigatordata_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectdata_meta_data xnat_subjectdata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata_meta_data
    ADD CONSTRAINT xnat_subjectdata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectdata_meta_data xnat_subjectdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata_meta_data
    ADD CONSTRAINT xnat_subjectdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectdata xnat_subjectdata_metadata_xnat_abstractsubjectmetadata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata
    ADD CONSTRAINT xnat_subjectdata_metadata_xnat_abstractsubjectmetadata_id_fkey FOREIGN KEY (metadata_xnat_abstractsubjectmetadata_id) REFERENCES public.xnat_abstractsubjectmetadata(xnat_abstractsubjectmetadata_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectdata xnat_subjectdata_project_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata
    ADD CONSTRAINT xnat_subjectdata_project_fkey FOREIGN KEY (project) REFERENCES public.xnat_projectdata(id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectdata_resource xnat_subjectdata_resource_xnat_abstractresource_xnat_abstr_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata_resource
    ADD CONSTRAINT xnat_subjectdata_resource_xnat_abstractresource_xnat_abstr_fkey FOREIGN KEY (xnat_abstractresource_xnat_abstractresource_id) REFERENCES public.xnat_abstractresource(xnat_abstractresource_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_subjectdata_resource xnat_subjectdata_resource_xnat_subjectdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata_resource
    ADD CONSTRAINT xnat_subjectdata_resource_xnat_subjectdata_id_fkey FOREIGN KEY (xnat_subjectdata_id) REFERENCES public.xnat_subjectdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_subjectdata xnat_subjectdata_subjectdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectdata
    ADD CONSTRAINT xnat_subjectdata_subjectdata_info_fkey FOREIGN KEY (subjectdata_info) REFERENCES public.xnat_subjectdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectmetadata_meta_data xnat_subjectmetadata_meta_dat_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectmetadata_meta_data
    ADD CONSTRAINT xnat_subjectmetadata_meta_dat_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectmetadata_meta_data xnat_subjectmetadata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectmetadata_meta_data
    ADD CONSTRAINT xnat_subjectmetadata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectmetadata xnat_subjectmetadata_subjectmetadata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectmetadata
    ADD CONSTRAINT xnat_subjectmetadata_subjectmetadata_info_fkey FOREIGN KEY (subjectmetadata_info) REFERENCES public.xnat_subjectmetadata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectmetadata xnat_subjectmetadata_xnat_abstractsubjectmetadata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectmetadata
    ADD CONSTRAINT xnat_subjectmetadata_xnat_abstractsubjectmetadata_id_fkey FOREIGN KEY (xnat_abstractsubjectmetadata_id) REFERENCES public.xnat_abstractsubjectmetadata(xnat_abstractsubjectmetadata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_subjectvariablesdata xnat_subjectvariablesdata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectvariablesdata
    ADD CONSTRAINT xnat_subjectvariablesdata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_subjectassessordata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_subjectvariablesdata_meta_data xnat_subjectvariablesdata_met_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectvariablesdata_meta_data
    ADD CONSTRAINT xnat_subjectvariablesdata_met_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectvariablesdata_meta_data xnat_subjectvariablesdata_meta_da_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectvariablesdata_meta_data
    ADD CONSTRAINT xnat_subjectvariablesdata_meta_da_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectvariablesdata xnat_subjectvariablesdata_subjectvariablesdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectvariablesdata
    ADD CONSTRAINT xnat_subjectvariablesdata_subjectvariablesdata_info_fkey FOREIGN KEY (subjectvariablesdata_info) REFERENCES public.xnat_subjectvariablesdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectvariablesdata_variable_meta_data xnat_subjectvariablesdata_var_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectvariablesdata_variable_meta_data
    ADD CONSTRAINT xnat_subjectvariablesdata_var_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectvariablesdata_variable xnat_subjectvariablesdata_var_subjectvariablesdata_variabl_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectvariablesdata_variable
    ADD CONSTRAINT xnat_subjectvariablesdata_var_subjectvariablesdata_variabl_fkey FOREIGN KEY (subjectvariablesdata_variable_info) REFERENCES public.xnat_subjectvariablesdata_variable_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_subjectvariablesdata_variable xnat_subjectvariablesdata_var_variables_variable_xnat_subj_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectvariablesdata_variable
    ADD CONSTRAINT xnat_subjectvariablesdata_var_variables_variable_xnat_subj_fkey FOREIGN KEY (variables_variable_xnat_subject_id) REFERENCES public.xnat_subjectvariablesdata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_subjectvariablesdata_variable_meta_data xnat_subjectvariablesdata_variabl_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_subjectvariablesdata_variable_meta_data
    ADD CONSTRAINT xnat_subjectvariablesdata_variabl_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_usscandata_meta_data xnat_usscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_usscandata_meta_data
    ADD CONSTRAINT xnat_usscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_usscandata_meta_data xnat_usscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_usscandata_meta_data
    ADD CONSTRAINT xnat_usscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_usscandata xnat_usscandata_usscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_usscandata
    ADD CONSTRAINT xnat_usscandata_usscandata_info_fkey FOREIGN KEY (usscandata_info) REFERENCES public.xnat_usscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_usscandata xnat_usscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_usscandata
    ADD CONSTRAINT xnat_usscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_ussessiondata xnat_ussessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ussessiondata
    ADD CONSTRAINT xnat_ussessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_ussessiondata_meta_data xnat_ussessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ussessiondata_meta_data
    ADD CONSTRAINT xnat_ussessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ussessiondata_meta_data xnat_ussessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ussessiondata_meta_data
    ADD CONSTRAINT xnat_ussessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_ussessiondata xnat_ussessiondata_ussessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_ussessiondata
    ADD CONSTRAINT xnat_ussessiondata_ussessiondata_info_fkey FOREIGN KEY (ussessiondata_info) REFERENCES public.xnat_ussessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_validationdata_meta_data xnat_validationdata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_validationdata_meta_data
    ADD CONSTRAINT xnat_validationdata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_validationdata_meta_data xnat_validationdata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_validationdata_meta_data
    ADD CONSTRAINT xnat_validationdata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_validationdata xnat_validationdata_validationdata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_validationdata
    ADD CONSTRAINT xnat_validationdata_validationdata_info_fkey FOREIGN KEY (validationdata_info) REFERENCES public.xnat_validationdata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_voiceaudioscandata_meta_data xnat_voiceaudioscandata_meta__activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_voiceaudioscandata_meta_data
    ADD CONSTRAINT xnat_voiceaudioscandata_meta__activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_voiceaudioscandata_meta_data xnat_voiceaudioscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_voiceaudioscandata_meta_data
    ADD CONSTRAINT xnat_voiceaudioscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_voiceaudioscandata xnat_voiceaudioscandata_voiceaudioscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_voiceaudioscandata
    ADD CONSTRAINT xnat_voiceaudioscandata_voiceaudioscandata_info_fkey FOREIGN KEY (voiceaudioscandata_info) REFERENCES public.xnat_voiceaudioscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_voiceaudioscandata xnat_voiceaudioscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_voiceaudioscandata
    ADD CONSTRAINT xnat_voiceaudioscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_volumetricregion_meta_data xnat_volumetricregion_meta_da_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_volumetricregion_meta_data
    ADD CONSTRAINT xnat_volumetricregion_meta_da_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_volumetricregion_meta_data xnat_volumetricregion_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_volumetricregion_meta_data
    ADD CONSTRAINT xnat_volumetricregion_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_volumetricregion_subregion_meta_data xnat_volumetricregion_subregi_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_volumetricregion_subregion_meta_data
    ADD CONSTRAINT xnat_volumetricregion_subregi_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_volumetricregion_subregion xnat_volumetricregion_subregi_subregions_subregion_xnat_vo_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_volumetricregion_subregion
    ADD CONSTRAINT xnat_volumetricregion_subregi_subregions_subregion_xnat_vo_fkey FOREIGN KEY (subregions_subregion_xnat_volum_xnat_volumetricregion_id) REFERENCES public.xnat_volumetricregion(xnat_volumetricregion_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_volumetricregion_subregion xnat_volumetricregion_subregi_volumetricregion_subregion_i_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_volumetricregion_subregion
    ADD CONSTRAINT xnat_volumetricregion_subregi_volumetricregion_subregion_i_fkey FOREIGN KEY (volumetricregion_subregion_info) REFERENCES public.xnat_volumetricregion_subregion_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_volumetricregion_subregion_meta_data xnat_volumetricregion_subregion_m_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_volumetricregion_subregion_meta_data
    ADD CONSTRAINT xnat_volumetricregion_subregion_m_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_volumetricregion xnat_volumetricregion_volumetricregion_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_volumetricregion
    ADD CONSTRAINT xnat_volumetricregion_volumetricregion_info_fkey FOREIGN KEY (volumetricregion_info) REFERENCES public.xnat_volumetricregion_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xa3dscandata_meta_data xnat_xa3dscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xa3dscandata_meta_data
    ADD CONSTRAINT xnat_xa3dscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xa3dscandata_meta_data xnat_xa3dscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xa3dscandata_meta_data
    ADD CONSTRAINT xnat_xa3dscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xa3dscandata xnat_xa3dscandata_xa3dscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xa3dscandata
    ADD CONSTRAINT xnat_xa3dscandata_xa3dscandata_info_fkey FOREIGN KEY (xa3dscandata_info) REFERENCES public.xnat_xa3dscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xa3dscandata xnat_xa3dscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xa3dscandata
    ADD CONSTRAINT xnat_xa3dscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_xa3dsessiondata xnat_xa3dsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xa3dsessiondata
    ADD CONSTRAINT xnat_xa3dsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_xa3dsessiondata_meta_data xnat_xa3dsessiondata_meta_dat_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xa3dsessiondata_meta_data
    ADD CONSTRAINT xnat_xa3dsessiondata_meta_dat_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xa3dsessiondata_meta_data xnat_xa3dsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xa3dsessiondata_meta_data
    ADD CONSTRAINT xnat_xa3dsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xa3dsessiondata xnat_xa3dsessiondata_xa3dsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xa3dsessiondata
    ADD CONSTRAINT xnat_xa3dsessiondata_xa3dsessiondata_info_fkey FOREIGN KEY (xa3dsessiondata_info) REFERENCES public.xnat_xa3dsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xascandata_meta_data xnat_xascandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xascandata_meta_data
    ADD CONSTRAINT xnat_xascandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xascandata_meta_data xnat_xascandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xascandata_meta_data
    ADD CONSTRAINT xnat_xascandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xascandata xnat_xascandata_parameters_contrastbolus_xnat_contrastbolu_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xascandata
    ADD CONSTRAINT xnat_xascandata_parameters_contrastbolus_xnat_contrastbolu_fkey FOREIGN KEY (parameters_contrastbolus_xnat_contrastbolus_id) REFERENCES public.xnat_contrastbolus(xnat_contrastbolus_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xascandata xnat_xascandata_xascandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xascandata
    ADD CONSTRAINT xnat_xascandata_xascandata_info_fkey FOREIGN KEY (xascandata_info) REFERENCES public.xnat_xascandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xascandata xnat_xascandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xascandata
    ADD CONSTRAINT xnat_xascandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_xasessiondata xnat_xasessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xasessiondata
    ADD CONSTRAINT xnat_xasessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_xasessiondata_meta_data xnat_xasessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xasessiondata_meta_data
    ADD CONSTRAINT xnat_xasessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xasessiondata_meta_data xnat_xasessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xasessiondata_meta_data
    ADD CONSTRAINT xnat_xasessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xasessiondata xnat_xasessiondata_xasessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xasessiondata
    ADD CONSTRAINT xnat_xasessiondata_xasessiondata_info_fkey FOREIGN KEY (xasessiondata_info) REFERENCES public.xnat_xasessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xcscandata_meta_data xnat_xcscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcscandata_meta_data
    ADD CONSTRAINT xnat_xcscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xcscandata_meta_data xnat_xcscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcscandata_meta_data
    ADD CONSTRAINT xnat_xcscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xcscandata xnat_xcscandata_xcscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcscandata
    ADD CONSTRAINT xnat_xcscandata_xcscandata_info_fkey FOREIGN KEY (xcscandata_info) REFERENCES public.xnat_xcscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xcscandata xnat_xcscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcscandata
    ADD CONSTRAINT xnat_xcscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_xcsessiondata xnat_xcsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcsessiondata
    ADD CONSTRAINT xnat_xcsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_xcsessiondata_meta_data xnat_xcsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcsessiondata_meta_data
    ADD CONSTRAINT xnat_xcsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xcsessiondata_meta_data xnat_xcsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcsessiondata_meta_data
    ADD CONSTRAINT xnat_xcsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xcsessiondata xnat_xcsessiondata_xcsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcsessiondata
    ADD CONSTRAINT xnat_xcsessiondata_xcsessiondata_info_fkey FOREIGN KEY (xcsessiondata_info) REFERENCES public.xnat_xcsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xcvscandata_meta_data xnat_xcvscandata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcvscandata_meta_data
    ADD CONSTRAINT xnat_xcvscandata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xcvscandata_meta_data xnat_xcvscandata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcvscandata_meta_data
    ADD CONSTRAINT xnat_xcvscandata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xcvscandata xnat_xcvscandata_xcvscandata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcvscandata
    ADD CONSTRAINT xnat_xcvscandata_xcvscandata_info_fkey FOREIGN KEY (xcvscandata_info) REFERENCES public.xnat_xcvscandata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xcvscandata xnat_xcvscandata_xnat_imagescandata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcvscandata
    ADD CONSTRAINT xnat_xcvscandata_xnat_imagescandata_id_fkey FOREIGN KEY (xnat_imagescandata_id) REFERENCES public.xnat_imagescandata(xnat_imagescandata_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_xcvsessiondata xnat_xcvsessiondata_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcvsessiondata
    ADD CONSTRAINT xnat_xcvsessiondata_id_fkey FOREIGN KEY (id) REFERENCES public.xnat_imagesessiondata(id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: xnat_xcvsessiondata_meta_data xnat_xcvsessiondata_meta_data_activation_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcvsessiondata_meta_data
    ADD CONSTRAINT xnat_xcvsessiondata_meta_data_activation_user_xdat_user_id_fkey FOREIGN KEY (activation_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xcvsessiondata_meta_data xnat_xcvsessiondata_meta_data_insert_user_xdat_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcvsessiondata_meta_data
    ADD CONSTRAINT xnat_xcvsessiondata_meta_data_insert_user_xdat_user_id_fkey FOREIGN KEY (insert_user_xdat_user_id) REFERENCES public.xdat_user(xdat_user_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: xnat_xcvsessiondata xnat_xcvsessiondata_xcvsessiondata_info_fkey; Type: FK CONSTRAINT; Schema: public; Owner: xnat
--

ALTER TABLE ONLY public.xnat_xcvsessiondata
    ADD CONSTRAINT xnat_xcvsessiondata_xcvsessiondata_info_fkey FOREIGN KEY (xcvsessiondata_info) REFERENCES public.xnat_xcvsessiondata_meta_data(meta_data_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: TABLE xs_fav_entries; Type: ACL; Schema: xdat_search; Owner: xnat
--

GRANT ALL ON TABLE xdat_search.xs_fav_entries TO PUBLIC;


--
-- Name: TABLE xs_item_access; Type: ACL; Schema: xdat_search; Owner: xnat
--

GRANT ALL ON TABLE xdat_search.xs_item_access TO PUBLIC;


--
-- Name: TABLE xdat_searches; Type: ACL; Schema: public; Owner: xnat
--

GRANT ALL ON TABLE public.xdat_searches TO PUBLIC;


--
-- Name: TABLE xs_materialized_views; Type: ACL; Schema: xdat_search; Owner: xnat
--

GRANT ALL ON TABLE xdat_search.xs_materialized_views TO PUBLIC;


--
--

