app
--

ALTER TABLE ONLY datasetlinkingdataverse
    ADD CONSTRAINT fk_datasetlinkingdataverse_linkingdataverse_id FOREIGN KEY (linkingdataverse_id) REFERENCES dvobject(id);


--
-- Name: fk_datasetlock_dataset_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY datasetlock
    ADD CONSTRAINT fk_datasetlock_dataset_id FOREIGN KEY (dataset_id) REFERENCES dvobject(id);


--
-- Name: fk_datasetlock_user_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY datasetlock
    ADD CONSTRAINT fk_datasetlock_user_id FOREIGN KEY (user_id) REFERENCES authenticateduser(id);


--
-- Name: fk_datasetversion_dataset_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY datasetversion
    ADD CONSTRAINT fk_datasetversion_dataset_id FOREIGN KEY (dataset_id) REFERENCES dvobject(id);


--
-- Name: fk_datasetversionuser_authenticateduser_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY datasetversionuser
    ADD CONSTRAINT fk_datasetversionuser_authenticateduser_id FOREIGN KEY (authenticateduser_id) REFERENCES authenticateduser(id);


--
-- Name: fk_datasetversionuser_datasetversion_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY datasetversionuser
    ADD CONSTRAINT fk_datasetversionuser_datasetversion_id FOREIGN KEY (datasetversion_id) REFERENCES datasetversion(id);


--
-- Name: fk_datatable_datafile_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY datatable
    ADD CONSTRAINT fk_datatable_datafile_id FOREIGN KEY (datafile_id) REFERENCES dvobject(id);


--
-- Name: fk_datavariable_datatable_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY datavariable
    ADD CONSTRAINT fk_datavariable_datatable_id FOREIGN KEY (datatable_id) REFERENCES datatable(id);


--
-- Name: fk_dataverse_defaultcontributorrole_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataverse
    ADD CONSTRAINT fk_dataverse_defaultcontributorrole_id FOREIGN KEY (defaultcontributorrole_id) REFERENCES dataverserole(id);


--
-- Name: fk_dataverse_defaulttemplate_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataverse
    ADD CONSTRAINT fk_dataverse_defaulttemplate_id FOREIGN KEY (defaulttemplate_id) REFERENCES template(id);


--
-- Name: fk_dataverse_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataverse
    ADD CONSTRAINT fk_dataverse_id FOREIGN KEY (id) REFERENCES dvobject(id);


--
-- Name: fk_dataverse_metadatablock_dataverse_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataverse_metadatablock
    ADD CONSTRAINT fk_dataverse_metadatablock_dataverse_id FOREIGN KEY (dataverse_id) REFERENCES dvobject(id);


--
-- Name: fk_dataverse_metadatablock_metadatablocks_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataverse_metadatablock
    ADD CONSTRAINT fk_dataverse_metadatablock_metadatablocks_id FOREIGN KEY (metadatablocks_id) REFERENCES metadatablock(id);


--
-- Name: fk_dataversecontact_dataverse_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataversecontact
    ADD CONSTRAINT fk_dataversecontact_dataverse_id FOREIGN KEY (dataverse_id) REFERENCES dvobject(id);


--
-- Name: fk_dataversefacet_datasetfieldtype_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataversefacet
    ADD CONSTRAINT fk_dataversefacet_datasetfieldtype_id FOREIGN KEY (datasetfieldtype_id) REFERENCES datasetfieldtype(id);


--
-- Name: fk_dataversefacet_dataverse_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataversefacet
    ADD CONSTRAINT fk_dataversefacet_dataverse_id FOREIGN KEY (dataverse_id) REFERENCES dvobject(id);


--
-- Name: fk_dataversefeatureddataverse_dataverse_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataversefeatureddataverse
    ADD CONSTRAINT fk_dataversefeatureddataverse_dataverse_id FOREIGN KEY (dataverse_id) REFERENCES dvobject(id);


--
-- Name: fk_dataversefeatureddataverse_featureddataverse_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataversefeatureddataverse
    ADD CONSTRAINT fk_dataversefeatureddataverse_featureddataverse_id FOREIGN KEY (featureddataverse_id) REFERENCES dvobject(id);


--
-- Name: fk_dataversefieldtypeinputlevel_datasetfieldtype_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataversefieldtypeinputlevel
    ADD CONSTRAINT fk_dataversefieldtypeinputlevel_datasetfieldtype_id FOREIGN KEY (datasetfieldtype_id) REFERENCES datasetfieldtype(id);


--
-- Name: fk_dataversefieldtypeinputlevel_dataverse_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataversefieldtypeinputlevel
    ADD CONSTRAINT fk_dataversefieldtypeinputlevel_dataverse_id FOREIGN KEY (dataverse_id) REFERENCES dvobject(id);


--
-- Name: fk_dataverselinkingdataverse_dataverse_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataverselinkingdataverse
    ADD CONSTRAINT fk_dataverselinkingdataverse_dataverse_id FOREIGN KEY (dataverse_id) REFERENCES dvobject(id);


--
-- Name: fk_dataverselinkingdataverse_linkingdataverse_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataverselinkingdataverse
    ADD CONSTRAINT fk_dataverselinkingdataverse_linkingdataverse_id FOREIGN KEY (linkingdataverse_id) REFERENCES dvobject(id);


--
-- Name: fk_dataverserole_owner_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataverserole
    ADD CONSTRAINT fk_dataverserole_owner_id FOREIGN KEY (owner_id) REFERENCES dvobject(id);


--
-- Name: fk_dataversesubjects_controlledvocabularyvalue_id; Type: FK CONSTRAINT; Schema: public; Owner: dataverse_app
--

ALTER TABLE ONLY dataversesubjects
    ADD CONSTRAINT fk_dataversesubjects_controlledvocabularyvalue_id