-- -------\012-- Modify PERSON\012-- -------\012\012ALTER TABLE persons\012    ADD COLUMN display_settings file;\012\012\012-------------------------------------------------------------------------\012--  Purpose:  Insert additional initial data set into the table FILE_FORMAT_TYPES\012-------------------------------------------------------------------------\012\012insert into file_format_types\012(id\012,code\012,description\012,dbin_id)\012values \012(nextval('FILE_FORMAT_TYPE_ID_SEQ')\012,'HDF5'\012,'Hierarchical Data Format File, version 5'\012,(select id from database_instances where is_original_source = 'T')\012);\012\012insert into file_format_types\012(id\012,code\012,description\012,dbin_id)\012values \012(nextval('FILE_FORMAT_TYPE_ID_SEQ')\012,'PROPRIETARY'\012,'Proprietary Format File'\012,(select id from database_instances where is_original_source = 'T')\012);\012\012insert into file_format_types\012(id\012,code\012,description\012,dbin_id)\012values \012(nextval('FILE_FORMAT_TYPE_ID_SEQ')\012,'SRF'\012,'Sequence Read Format File'\012,(select id from database_instances where is_original_source = 'T')\012);\012\012insert into file_format_types\012(id\012,code\012,description\012,dbin_id)\012values \012(nextval('FILE_FORMAT_TYPE_ID_SEQ')\012,'TSV'\012,'Tab Separated Values File'\012,(select id from database_instances where is_original_source = 'T')\012);\012\012insert into file_format_types\012(id\012,code\012,description\012,dbin_id)\012values \012(nextval('FILE_FORMAT_TYPE_ID_SEQ')\012,'XML'\012,'XML File'\012,(select id from database_instances where is_original_source = 'T')\012);\012\012-------------------------------------------------------------------------\012--  Purpose:  Delete etpt assignments when entity-types are deleted \012-------------------------------------------------------------------------\012\012ALTER TABLE MATERIAL_TYPE_PROPERTY_TYPES DROP CONSTRAINT MTPT_MATY_FK;\012ALTER TABLE MATERIAL_TYPE_PROPERTY_TYPES ADD CONSTRAINT MTPT_MATY_FK FOREIGN KEY (MATY_ID) REFERENCES MATERIAL_TYPES(ID) ON DELETE CASCADE;\012ALTER TABLE SAMPLE_TYPE_PROPERTY_TYPES DROP CONSTRAINT STPT_SATY_FK;\012ALTER TABLE SAMPLE_TYPE_PROPERTY_TYPES ADD CONSTRAINT STPT_SATY_FK FOREIGN KEY (SATY_ID) REFERENCES SAMPLE_TYPES(ID) ON DELETE CASCADE;\012ALTER TABLE DATA_SET_TYPE_PROPERTY_TYPES DROP CONSTRAINT DSTPT_DSTY_FK;\012ALTER TABLE DATA_SET_TYPE_PROPERTY_TYPES ADD CONSTRAINT DSTPT_DSTY_FK FOREIGN KEY (DSTY_ID) REFERENCES DATA_SET_TYPES(ID)  ON DELETE CASCADE;\012ALTER TABLE EXPERIMENT_TYPE_PROPERTY_TYPES DROP CONSTRAINT ETPT_EXTY_FK;\012ALTER TABLE EXPERIMENT_TYPE_PROPERTY_TYPES ADD CONSTRAINT ETPT_EXTY_FK FOREIGN KEY (EXTY_ID) REFERENCES EXPERIMENT_TYPES(ID) ON DELETE CASCADE;\012\012-------------------------------------------------------------------------\012--  Purpose:  Delete property types when material-types are deleted \012-------------------------------------------------------------------------\012ALTER TABLE PROPERTY_TYPES DROP CONSTRAINT PRTY_MATY_FK;\012ALTER TABLE PROPERTY_TYPES ADD CONSTRAINT PRTY_MATY_FK FOREIGN KEY (MATY_PROP_ID) REFERENCES MATERIAL_TYPES(ID) ON DELETE CASCADE;\012\012-------------------------------------------------------------------------\012--  Purpose:  Delete etpt assignments when property-types are deleted \012-------------------------------------------------------------------------\012ALTER TABLE EXPERIMENT_TYPE_PROPERTY_TYPES DROP CONSTRAINT ETPT_PRTY_FK;\012ALTER TABLE EXPERIMENT_TYPE_PROPERTY_TYPES ADD CONSTRAINT ETPT_PRTY_FK FOREIGN KEY (PRTY_ID) REFERENCES PROPERTY_TYPES(ID) ON DELETE CASCADE;\012\012ALTER TABLE MATERIAL_TYPE_PROPERTY_TYPES DROP CONSTRAINT MTPT_PRTY_FK;\012ALTER TABLE MATERIAL_TYPE_PROPERTY_TYPES ADD CONSTRAINT MTPT_PRTY_FK FOREIGN KEY (PRTY_ID) REFERENCES PROPERTY_TYPES(ID) ON DELETE CASCADE;\012\012ALTER TABLE SAMPLE_TYPE_PROPERTY_TYPES DROP CONSTRAINT STPT_PRTY_FK;\012ALTER TABLE SAMPLE_TYPE_PROPERTY_TYPES ADD CONSTRAINT STPT_PRTY_FK FOREIGN KEY (PRTY_ID) REFERENCES PROPERTY_TYPES(ID) ON DELETE CASCADE;\012\012ALTER TABLE DATA_SET_TYPE_PROPERTY_TYPES DROP CONSTRAINT DSTPT_PRTY_FK;\012ALTER TABLE DATA_SET_TYPE_PROPERTY_TYPES ADD CONSTRAINT DSTPT_PRTY_FK FOREIGN KEY (PRTY_ID) REFERENCES PROPERTY_TYPES(ID) ON DELETE CASCADE;\012