db.migration.v0.31.0.1__linkml_v2.1.0_update.sql Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of agr_curation_api Show documentation
Show all versions of agr_curation_api Show documentation
This software is for using the curation api as a library
-- Update association column names for non-biological entity fields
ALTER TABLE constructgenomicentityassociation RENAME objectgenomicentity_curie TO object_curie;
ALTER TABLE constructgenomicentityassociation RENAME subjectconstruct_id TO constructassociationsubject_id;
ALTER TABLE allelegeneassociation RENAME objectgene_curie TO object_curie;
-- Random cleanup
ALTER TABLE organization DROP COLUMN IF EXISTS uniqueid;
DROP TABLE IF EXISTS paperhandle;
DROP TABLE IF EXISTS paperhandle_aud;
ALTER TABLE agmdiseaseannotation DROP COLUMN IF EXISTS predicate;
ALTER TABLE allelediseaseannotation DROP COLUMN IF EXISTS predicate;
ALTER TABLE genediseaseannotation DROP COLUMN IF EXISTS predicate;
-- Drop audit tables
DROP TABLE affectedgenomicmodel_aud;
DROP TABLE agmdiseaseannotation_aud;
DROP TABLE agmdiseaseannotation_gene_aud;
DROP TABLE allele_aud;
DROP TABLE allele_note_aud;
DROP TABLE allele_reference_aud;
DROP TABLE alleledatabasestatusslotannotation_aud;
DROP TABLE allelediseaseannotation_aud;
DROP TABLE allelediseaseannotation_gene_aud;
DROP TABLE allelefullnameslotannotation_aud;
DROP TABLE allelefunctionalimpactslotannotation_aud;
DROP TABLE allelefunctionalimpactslotannotation_vocabularyterm_aud;
DROP TABLE allelegeneassociation_aud;
DROP TABLE allelegenomicentityassociation_aud;
DROP TABLE allelegermlinetransmissionstatusslotannotation_aud;
DROP TABLE alleleinheritancemodeslotannotation_aud;
DROP TABLE allelemutationtypeslotannotation_aud;
DROP TABLE allelemutationtypeslotannotation_soterm_aud;
DROP TABLE allelenomenclatureeventslotannotation_aud;
DROP TABLE allelesecondaryidslotannotation_aud;
DROP TABLE allelesymbolslotannotation_aud;
DROP TABLE allelesynonymslotannotation_aud;
DROP TABLE alliancemember_aud;
DROP TABLE annotation_conditionrelation_aud;
DROP TABLE annotation_note_aud;
DROP TABLE apoterm_aud;
DROP TABLE atpterm_aud;
DROP TABLE bspoterm_aud;
DROP TABLE bulkfmsload_aud;
DROP TABLE bulkloadfile_aud;
DROP TABLE bulkloadfileexception_aud;
DROP TABLE bulkloadfilehistory_aud;
DROP TABLE bulkloadgroup_aud;
DROP TABLE bulkmanualload_aud;
DROP TABLE bulkurlload_aud;
DROP TABLE bulkscheduledload_aud;
DROP TABLE chebiterm_aud;
DROP TABLE clterm_aud;
DROP TABLE cmoterm_aud;
DROP TABLE conditionrelation_aud;
DROP TABLE conditionrelation_experimentalcondition_aud;
DROP TABLE construct_aud;
DROP TABLE construct_reference_aud;
DROP TABLE constructcomponentslotannotation_aud;
DROP TABLE constructcomponentslotannotation_note_aud;
DROP TABLE constructfullnameslotannotation_aud;
DROP TABLE constructgenomicentityassociation_aud;
DROP TABLE constructgenomicentityassociation_note_aud;
DROP TABLE constructsymbolslotannotation_aud;
DROP TABLE constructsynonymslotannotation_aud;
DROP TABLE crossreference_aud;
DROP TABLE curationreport_aud;
DROP TABLE curationreportgroup_aud;
DROP TABLE curationreporthistory_aud;
DROP TABLE daoterm_aud;
DROP TABLE dataprovider_aud;
DROP TABLE diseaseannotation_biologicalentity_aud;
DROP TABLE diseaseannotation_ecoterm_aud;
DROP TABLE diseaseannotation_gene_aud;
DROP TABLE diseaseannotation_vocabularyterm_aud;
DROP TABLE doterm_aud;
DROP TABLE dpoterm_aud;
DROP TABLE ecoterm_aud;
DROP TABLE emapaterm_aud;
DROP TABLE evidenceassociation_informationcontententity_aud;
DROP TABLE experimentalcondition_aud;
DROP TABLE fbdvterm_aud;
DROP TABLE gene_aud;
DROP TABLE genediseaseannotation_aud;
DROP TABLE genefullnameslotannotation_aud;
DROP TABLE genesecondaryidslotannotation_aud;
DROP TABLE genesymbolslotannotation_aud;
DROP TABLE genesynonymslotannotation_aud;
DROP TABLE genesystematicnameslotannotation_aud;
DROP TABLE genetogeneorthologycurated_aud;
DROP TABLE genetogeneorthologygenerated_aud;
DROP TABLE genetogeneorthology_aud;
DROP TABLE genetogeneorthologygenerated_predictionmethodsmatched_aud;
DROP TABLE genetogeneorthologygenerated_predictionmethodsnotcalled_aud;
DROP TABLE genetogeneorthologygenerated_predictionmethodsnotmatched_aud;
DROP TABLE genomicentity_crossreference_aud;
DROP TABLE goterm_aud;
DROP TABLE hpterm_aud;
DROP TABLE materm_aud;
DROP TABLE miterm_aud;
DROP TABLE mmoterm_aud;
DROP TABLE mmusdvterm_aud;
DROP TABLE modterm_aud;
DROP TABLE molecule_aud;
DROP TABLE mpathterm_aud;
DROP TABLE mpterm_aud;
DROP TABLE ncbitaxonterm_aud;
DROP TABLE note_aud;
DROP TABLE note_reference_aud;
DROP TABLE obiterm_aud;
DROP TABLE ontologyterm_crossreference_aud;
DROP TABLE ontologyterm_definitionurls_aud;
DROP TABLE ontologyterm_isa_ancestor_descendant_aud;
DROP TABLE ontologyterm_isa_parent_children_aud;
DROP TABLE ontologyterm_secondaryidentifiers_aud;
DROP TABLE ontologyterm_subsets_aud;
DROP TABLE ontologyterm_synonym_aud;
DROP TABLE organization_aud;
DROP TABLE patoterm_aud;
DROP TABLE person_aud;
DROP TABLE person_emails_aud;
DROP TABLE person_oldemails_aud;
DROP TABLE personsetting_aud;
DROP TABLE pwterm_aud;
DROP TABLE reagent_aud;
DROP TABLE reagent_secondaryidentifiers_aud;
DROP TABLE reference_aud;
DROP TABLE reference_crossreference_aud;
DROP TABLE resourcedescriptor_aud;
DROP TABLE resourcedescriptor_synonyms_aud;
DROP TABLE resourcedescriptorpage_aud;
DROP TABLE roterm_aud;
DROP TABLE rsterm_aud;
DROP TABLE slotannotation_informationcontententity_aud;
DROP TABLE soterm_aud;
DROP TABLE species_aud;
DROP TABLE species_commonnames_aud;
DROP TABLE synonym_aud;
DROP TABLE uberonterm_aud;
DROP TABLE variant_aud;
DROP TABLE variant_note_aud;
DROP TABLE vocabulary_aud;
DROP TABLE vocabularyterm_aud;
DROP TABLE vocabularyterm_synonyms_aud;
DROP TABLE vocabularytermset_aud;
DROP TABLE vocabularytermset_vocabularyterm_aud;
DROP TABLE vtterm_aud;
DROP TABLE wbbtterm_aud;
DROP TABLE wblsterm_aud;
DROP TABLE wbphenotypeterm_aud;
DROP TABLE xbaterm_aud;
DROP TABLE xbedterm_aud;
DROP TABLE xbsterm_aud;
DROP TABLE xcoterm_aud;
DROP TABLE xpoterm_aud;
DROP TABLE xsmoterm_aud;
DROP TABLE zecoterm_aud;
DROP TABLE zfaterm_aud;
DROP TABLE zfsterm_aud;
DROP TABLE anatomicalterm_aud;
DROP TABLE chemicalterm_aud;
DROP TABLE experimentalconditionontologyterm_aud;
DROP TABLE phenotypeterm_aud;
DROP TABLE stageterm_aud;
DROP TABLE ontologyterm_aud;
DROP TABLE genomicentity_aud;
DROP TABLE biologicalentity_aud;
DROP TABLE bulkload_aud;
DROP TABLE informationcontententity_aud;
DROP TABLE secondaryidslotannotation_aud;
DROP TABLE nameslotannotation_aud;
DROP TABLE slotannotation_aud;
DROP TABLE diseaseannotation_aud;
DROP TABLE annotation_aud;
DROP TABLE singlereferenceassociation_aud;
DROP TABLE evidenceassociation_aud;
DROP TABLE association_aud;
DROP TABLE revinfo;
-- Drop indexes and constraints
ALTER TABLE affectedgenomicmodel DROP CONSTRAINT fkke1qw7ijaa33fqv1bifsiwiv9;
ALTER TABLE agmdiseaseannotation DROP CONSTRAINT agmdiseaseannotation_assertedallele_curie_fk;
ALTER TABLE agmdiseaseannotation DROP CONSTRAINT fk_agmdasubject;
ALTER TABLE agmdiseaseannotation DROP CONSTRAINT fko9dilcfxv6tw0oaeds0yss8op;
ALTER TABLE agmdiseaseannotation RENAME CONSTRAINT fkp1rktcpoyvnr2f756ncdb8k24 TO agmdiseaseannotation_id_fk;
ALTER TABLE agmdiseaseannotation DROP CONSTRAINT fktj1uj3to13fi4q32bc2p65lah;
ALTER TABLE agmdiseaseannotation_gene DROP CONSTRAINT agmdiseaseannotation_gene_assertedgenes_curie_fk;
ALTER INDEX idxbcpc5ib23w0ssq0wskm99vxmq RENAME TO agmdiseaseannotation_gene_agmdiseaseannotation_index;
ALTER TABLE allele DROP CONSTRAINT fk42r7586hi59wcwakfyr30l6l3;
ALTER TABLE allele_note DROP CONSTRAINT allele_note_allele_curie_fk;
ALTER TABLE allele_note DROP CONSTRAINT uk_3ja9wii4jxp0krcfpturumjhb;
ALTER TABLE allele_note RENAME CONSTRAINT allele_note_relatednotes_id_key TO allele_note_relatednotes_id_uk;
ALTER INDEX idx3ja9wii4jxp0krcfpturumjhb RENAME TO allele_note_relatednotes_index;
DROP INDEX idx50j986kkb5ymfepkamokl1q9w;
ALTER TABLE allele_reference DROP CONSTRAINT allele_reference_allele_curie_fk;
ALTER TABLE allele_reference DROP CONSTRAINT allele_reference_references_curie_fk;
DROP INDEX idxce99mr9ponwii377kkwpess1l;
DROP INDEX idxo6e5hexti6nfdj1v6ytnlwjvd;
DROP INDEX idxsfk08sqo0k364ixvsd8iui53i;
ALTER TABLE alleledatabasestatusslotannotation DROP CONSTRAINT alleledatabasestatus_singleallele_curie_fk;
ALTER INDEX alleledatabasestatus_databasestatus_id_index RENAME TO alleledatabasestatus_databasestatus_index;
DROP INDEX alleledatabasestatus_singleallele_curie_index;
ALTER TABLE allelediseaseannotation DROP CONSTRAINT fk_alleledasubject;
ALTER TABLE allelediseaseannotation RENAME CONSTRAINT fk3unb0kaxocbodllqe35hu4w0c TO allelediseaseannotation_id_fk;
ALTER TABLE allelediseaseannotation DROP CONSTRAINT fknecrivvmqgg2ifhppubrjy5ey;
DROP INDEX allelediseaseannotation_inferredgene_index;
DROP INDEX allelediseaseannotation_subject_index;
ALTER TABLE allelediseaseannotation_gene DROP CONSTRAINT allelediseaseannotation_gene_assertedgenes_curie_fk;
ALTER INDEX idxgb71atjgxqcgqnronvuprq8g4 RENAME TO allelediseaseannotationgene_diseaseannotation_index;
DROP INDEX idxf6sdkewbxohussr4fs7440vj5;
ALTER TABLE allelefullnameslotannotation DROP CONSTRAINT allelefullnameslotannotation_singleallele_curie_fk;
DROP INDEX allelefullname_singleallele_curie_index;
ALTER TABLE allelefunctionalimpactslotannotation DROP CONSTRAINT allelefunctionalimpactslotannotation_singleallele_curie_fk;
ALTER TABLE allelefunctionalimpactslotannotation RENAME CONSTRAINT fkng1x5duqyvks0enxdtr7andrl TO allelefunctionalimpactslotannotation_id_fk;
ALTER TABLE allelefunctionalimpactslotannotation DROP CONSTRAINT allelefunctionalimpactslotannotation_phenotypeterm_curie_fk;
ALTER TABLE allelefunctionalimpactslotannotation_vocabularyterm RENAME CONSTRAINT allelefunctionalimpactsa_vocabterm_afisa_curie_fk TO allelefunctionalimpactsa_vocabterm_afisa_id_fk;
ALTER TABLE allelefunctionalimpactslotannotation_vocabularyterm RENAME CONSTRAINT allelefunctionalimpactsa_vocabterm_functionimpacts_id_fk TO allelefunctionalimpactsa_vocabterm_functionalimpacts_id_fk;
ALTER INDEX allelefunctionalimpactslotannotation_functionalimpacts_id_index RENAME TO allelefunctionalimpactsa_vocabterm_functionalimpacts_index;
ALTER INDEX allelefunctionalimpactslotannotation_id_index RENAME TO allelefunctionalimpactsa_vocabterm_afisa_index;
ALTER TABLE allelegeneassociation DROP CONSTRAINT allelegeneassociation_object_curie_fk;
ALTER TABLE allelegeneassociation DROP CONSTRAINT allelegeneassociation_subject_curie_fk;
DROP INDEX allelegeneassociation_object_index;
DROP INDEX allelegeneassociation_subject_index;
ALTER TABLE allelegenomicentityassociation DROP CONSTRAINT allelegenomicentityassociation_evidencecode_curie_fk;
ALTER TABLE allelegenomicentityassociation RENAME CONSTRAINT fk1qks8xk2i7ml0qnhgx8q6ieex TO allelegenomicentityassociation_id_fk;
ALTER TABLE allelegermlinetransmissionstatusslotannotation DROP CONSTRAINT allelegermlinetransmissionstatus_singleallele_curie_fk;
ALTER TABLE allelegermlinetransmissionstatusslotannotation RENAME CONSTRAINT fkimjfrsvtapxj0gl4ocsfc68iy TO allelegermlinetransmissionstatus_id_fk;
ALTER INDEX allelegermlinetransmissionstatus_status_id_index RENAME TO allelegermlinetransmissionstatus_status_index;
ALTER TABLE alleleinheritancemodeslotannotation DROP CONSTRAINT alleleinheritancemodeslotannotation_phenotypeterm_curie_fk;
ALTER TABLE alleleinheritancemodeslotannotation DROP CONSTRAINT fkcgj3a3skh2a666q8wvehcs1pw;
DROP INDEX alleleinheritancemode_phenotypeterm_curie_index;
DROP INDEX alleleinheritancemode_singleallele_curie_index;
ALTER INDEX alleleinheritancemode_inheritancemode_id_index RENAME TO alleleinheritancemode_inheritancemode_index;
ALTER TABLE allelemutationtypeslotannotation RENAME CONSTRAINT allelemutationtypeslotannotationtype_id_fk TO allelemutationtypeslotannotation_id_fk;
ALTER TABLE allelemutationtypeslotannotation DROP CONSTRAINT allelemutationtypeslotannotationtype_singleallele_curie_fk;
DROP INDEX allelemutationtype_singleallele_curie_index;
ALTER TABLE allelemutationtypeslotannotation_soterm RENAME CONSTRAINT allelemutationtypeslotannotation_aud_amsa_id_fk TO allelemutationtypesa_soterm_amsa_id_fk;
ALTER TABLE allelemutationtypeslotannotation_soterm DROP CONSTRAINT allelemutationtypeslotannotation_aud_mutationtypes_curie_fk;
ALTER INDEX allelemutationtypeslotannotation_id_index RENAME TO allelemutationtypesa_soterm_amsa_index;
ALTER TABLE allelenomenclatureeventslotannotation DROP CONSTRAINT allelenomenclatureeventslotannotation_singleallele_curie_fk;
DROP INDEX allelenomenclatureevent_singleallele_curie_index;
ALTER INDEX allelenomenclatureevent_nomenclatureevent_id_index RENAME TO allelenomenclatureevent_nomenclatureevent_index;
ALTER TABLE allelesecondaryidslotannotation DROP CONSTRAINT allelesecondaryidslotannotation_singleallele_curie_fk;
ALTER TABLE allelesecondaryidslotannotation RENAME CONSTRAINT fko6369ool2dxdy8odi2i9brj4r TO allelesecondaryidslotannotation_id_fk;
DROP INDEX allelesecondaryid_singleallele_curie_index;
ALTER TABLE allelesymbolslotannotation DROP CONSTRAINT allelesymbolslotannotation_singleallele_curie_fk;
DROP INDEX allelesymbol_singleallele_curie_index;
ALTER TABLE allelesynonymslotannotation DROP CONSTRAINT allelesynonymslotannotation_singleallele_curie_fk;
DROP INDEX allelesynonym_singleallele_curie_index;
ALTER TABLE anatomicalterm DROP CONSTRAINT fkfepti479fro1b09ybaltkofqu;
ALTER INDEX annotation_conditionrelation_annotation_id_index RENAME TO annotation_conditionrelation_annotation_index;
ALTER INDEX annotation_conditionrelation_conditionrelations_id_index RENAME TO annotation_conditionrelation_conditionrelations_index;
ALTER TABLE annotation_note RENAME CONSTRAINT fks4im5g992bpgi6wa1rp9y8vil TO annotation_note_annotation_id_fk;
ALTER INDEX annotation_note_annotation_id_index RENAME TO annotation_note_annotation_index;
ALTER INDEX annotation_note_relatednotes_id_index RENAME TO annotation_note_relatednotes_index;
ALTER TABLE apoterm DROP CONSTRAINT apoterm_curie_fk;
ALTER TABLE atpterm DROP CONSTRAINT fksnxpka3rhxycguxrcyfyobtjf;
ALTER TABLE biologicalentity DROP CONSTRAINT fk5c19vicptarinu2wgj7xyhhum;
DROP INDEX biologicalentity_taxon_index;
ALTER TABLE bspoterm DROP CONSTRAINT bspoterm_curie_fk;
ALTER TABLE chebiterm DROP CONSTRAINT fk7enwyeblw2xt5yo5co0keko5f;
ALTER TABLE chemicalterm DROP CONSTRAINT fk2fegif3wy9egh5r2yy8wplrwu;
ALTER TABLE clterm DROP CONSTRAINT clterm_curie_fk;
ALTER TABLE cmoterm DROP CONSTRAINT cmoterm_curie_fk;
ALTER TABLE conditionrelation RENAME CONSTRAINT fkn8t4joy3iheftpbxt0omvxl52 TO conditionrelation_conditionrelationtype_id_fk;
ALTER TABLE conditionrelation DROP CONSTRAINT conditionrelation_singlereference_curie_fk;
ALTER TABLE construct_reference DROP CONSTRAINT construct_reference_references_curie_fk;
ALTER INDEX construct_reference_construct_id_index RENAME TO construct_reference_construct_index;
DROP INDEX construct_reference_references_curie_index;
ALTER TABLE constructcomponentslotannotation DROP CONSTRAINT constructcomponentslotannotation_taxon_curie_fk;
DROP INDEX constructcomponentslotannotation_taxon_index;
ALTER INDEX constructcomponentsa_note_ccsa_id_index RENAME TO constructcomponentsa_note_ccsa_index;
ALTER INDEX constructcomponentsa_note_relatednotes_id_index RENAME TO constructcomponentsa_note_relatednotes_index;
ALTER INDEX constructfullname_singleconstruct_id_index RENAME TO constructfullname_singleconstruct_index;
ALTER TABLE constructgenomicentityassociation DROP CONSTRAINT constructgenomicentityassociation_object_curie_fk;
ALTER TABLE constructgenomicentityassociation RENAME CONSTRAINT fkgrhw9gxslaub14x4b0mc7v9mk TO constructgenomicentityassociation_id_fk;
ALTER TABLE constructgenomicentityassociation RENAME CONSTRAINT constructgenomicentityassociation_subject_id_fk TO constructgenomicentityassociation_cgeassociationsubject_id_fk;
DROP INDEX constructgenomicentityassociation_object_index;
ALTER INDEX cgeassociation_note_cgeassociation_id_index RENAME TO cgeassociation_note_cgeassociation_index;
ALTER INDEX cgeassociation_note_relatednotes_id_index RENAME TO cgeassociation_note_relatednotes_index;
ALTER INDEX constructsymbol_singleconstruct_id_index RENAME TO constructsymbol_singleconstruct_index;
ALTER INDEX constructsynonym_singleconstruct_id_index RENAME TO constructsynonym_singleconstruct_index;
ALTER TABLE daoterm DROP CONSTRAINT fk3xjbjyyuqqyvspspeael1m7fe;
ALTER TABLE diseaseannotation DROP CONSTRAINT diseaseannotation_object_curie_fk;
DROP INDEX diseaseannotation_object_index;
ALTER TABLE diseaseannotation_biologicalentity DROP CONSTRAINT diseaseannotation_biologicalentity_dgm_curie_fk;
ALTER INDEX idxa408leg4b6rrhx0e0e35yno7t RENAME TO diseaseannotation_biologicalentity_diseaseannotation_index;
DROP INDEX idxon9a94gwp0jl6t2sfjqv0iwa5;
ALTER TABLE diseaseannotation_ecoterm RENAME CONSTRAINT fk43rw1jai2kqggx518nsu8c4me TO diseaseannotation_ecoterm_diseaseannotation_id_fk;
ALTER TABLE diseaseannotation_ecoterm DROP CONSTRAINT fkp79bf46xsyojpvjjguoe3vuuu;
DROP INDEX idx3u0swr7xss7wjjve7ocd08u27;
ALTER INDEX idxntbiegjxs3ooqy894m4y5vgwb RENAME TO diseaseannotation_ecoterm_diseaseannotation_index;
ALTER TABLE diseaseannotation_gene DROP CONSTRAINT fk6akpr16qusnfom0fdhjjevkb2;
ALTER TABLE diseaseannotation_gene RENAME CONSTRAINT fky4jlhsgseecd3gkxjtwp28ba TO diseaseannotation_gene_diseaseannotation_id_fk;
DROP INDEX idxc8bxs3ggb4rt2kmnqja0js5mq;
ALTER INDEX idxj6eavg6eannqn6uhvja6p4enf RENAME TO diseaseannotation_gene_diseaseannotation_index;
ALTER TABLE diseaseannotation_vocabularyterm RENAME CONSTRAINT fk7jhlm01yyrnyd26c5extqi9iv TO diseaseannotation_vocabularyterm_diseasequalifiers_id_fk;
ALTER TABLE diseaseannotation_vocabularyterm RENAME CONSTRAINT fkb7dg8qvpicnh87s0162sn62gl TO diseaseannotation_vocabularyterm_diseaseannotation_id_fk;
ALTER INDEX idxbnb14fsatd291upd9af38fnyp RENAME TO diseaseannotation_vocabularyterm_diseasequalifiers_index;
ALTER INDEX idxc8oiw5qoippfjl0b6s9oegiss RENAME TO diseaseannotation_vocabularyterm_diseaseannotation_index;
ALTER TABLE doterm DROP CONSTRAINT fkp8el2duba9ym3l6gd5dy43swk;
ALTER TABLE dpoterm DROP CONSTRAINT dpoterm_curie_fk;
ALTER TABLE ecoterm DROP CONSTRAINT fkskvp24kfp723htxmk0m9ev4ns;
ALTER TABLE emapaterm DROP CONSTRAINT fkcm3tpjo7lxsx61pj7gs5y9f9u;
ALTER TABLE evidenceassociation_informationcontententity DROP CONSTRAINT evidenceassociation_infocontent_evidence_curie_fk;
ALTER INDEX evidenceassociation_infocontent_evidenceassociation_id_index RENAME TO evidenceassociation_infocontent_evidenceassociation_index;
DROP INDEX evidenceassociation_infocontent_evidence_curie_index;
ALTER TABLE experimentalcondition DROP CONSTRAINT fk2rmhalgeg6rghpat78b2cpcoc;
ALTER TABLE experimentalcondition DROP CONSTRAINT fkagp6m2xqeu7bapu5hyh2pmha9;
ALTER TABLE experimentalcondition DROP CONSTRAINT fkcl89ywjgllce228a0uo8fd0ee;
ALTER TABLE experimentalcondition DROP CONSTRAINT fkhi2109btsx06x2u9kdg7y7xp0;
ALTER TABLE experimentalcondition DROP CONSTRAINT fkp0oqdnt9bmx68i84neufkcb3a;
ALTER TABLE experimentalcondition DROP CONSTRAINT fksso9a3875a8t0ver6u6qciuap;
ALTER TABLE experimentalconditionontologyterm DROP CONSTRAINT fk5jlaea2evnqnrlf72jglhqq6p;
ALTER TABLE fbdvterm DROP CONSTRAINT fkn7q3y19l70sef1h4f9ippnjoa;
ALTER TABLE gene DROP CONSTRAINT fk9v4jtwy759c3cfub0uxye5rue;
ALTER TABLE gene DROP CONSTRAINT fkiaxg0dhug3stym3gjovw598w1;
DROP INDEX gene_taxon_index;
ALTER TABLE genediseaseannotation RENAME CONSTRAINT fk3j5deigrhrwln0srh51vtw3m8 TO genediseaseannotation_id_fk;
ALTER TABLE genediseaseannotation DROP CONSTRAINT fk51h0w9jsd45qw5f3v2v0o28mu;
ALTER TABLE genediseaseannotation DROP CONSTRAINT fk_genedasubject;
ALTER TABLE genefullnameslotannotation DROP CONSTRAINT genefullnameslotannotation_singlegene_curie_fk;
DROP INDEX genefullname_singlegene_curie_index;
ALTER TABLE genesecondaryidslotannotation DROP CONSTRAINT fkhtdt6peje2s446u44ax3knp14;
ALTER TABLE genesecondaryidslotannotation RENAME CONSTRAINT fkq0oks812epecjvubiasibhw2s TO genesecondaryidslotannotation_id_fk;
DROP INDEX genesecondaryid_singlegene_curie_index;
ALTER TABLE genesymbolslotannotation DROP CONSTRAINT genesymbolslotannotation_singlegene_curie_fk;
DROP INDEX genesymbol_singlegene_curie_index;
ALTER TABLE genesynonymslotannotation DROP CONSTRAINT genesynonymslotannotation_singlegene_curie_fk;
DROP INDEX genesynonym_singlegene_curie_index;
ALTER TABLE genesystematicnameslotannotation DROP CONSTRAINT genesystematicnameslotannotation_singlegene_curie_fk;
DROP INDEX genesystematicname_singlegene_curie_index;
ALTER TABLE genetogeneorthology DROP CONSTRAINT genetogeneorthology_objectgene_curie_fk;
ALTER TABLE genetogeneorthology DROP CONSTRAINT genetogeneorthology_subjectgene_curie_fk;
DROP INDEX genetogeneorthology_objectgene_index;
DROP INDEX genetogeneorthology_subjectgene_index;
ALTER TABLE genetogeneorthologycurated DROP CONSTRAINT genetogeneorthologycurated_evidencecode_curie_fk;
ALTER TABLE genetogeneorthologycurated DROP CONSTRAINT genetogeneorthologycurated_singlereference_curie_fk;
DROP INDEX genetogeneorthologycurated_evidencecode_index;
DROP INDEX genetogeneorthologycurated_singlereference_index;
ALTER TABLE genomicentity DROP CONSTRAINT fkhi54si7gksfs3f6jrbytaddbi;
ALTER TABLE genomicentity_crossreference DROP CONSTRAINT fk9b9qofiu2sump8fnfxgux1lvl;
ALTER INDEX genomicentity_crossreference_crossreferences_id_index RENAME TO genomicentity_crossreference_crossreferences_index;
DROP INDEX genomicentity_crossreference_ge_curie_xref_id_index;
DROP INDEX genomicentity_crossreference_genomicentity_curie_index;
ALTER TABLE goterm DROP CONSTRAINT fk4gf262ba8btx03wi3vl5vhfao;
ALTER TABLE hpterm DROP CONSTRAINT hpterm_curie_fk;
DROP INDEX informationcontent_createdby_index;
DROP INDEX informationcontent_updatedby_index;
ALTER TABLE materm DROP CONSTRAINT fktlgqvrv4vuh8gqihevh6adya4;
ALTER TABLE miterm DROP CONSTRAINT miterm_curie_fk;
ALTER TABLE mmoterm DROP CONSTRAINT mmoterm_curie_fk;
ALTER TABLE mmusdvterm DROP CONSTRAINT fkmkv8r93hlnf06oa8xy2usdq9g;
ALTER TABLE modterm DROP CONSTRAINT modterm_curie_fk;
ALTER TABLE molecule DROP CONSTRAINT fknnf79fdaivbnqu0p9kes1jtd1;
ALTER TABLE mpathterm DROP CONSTRAINT mpathterm_curie_fk;
ALTER TABLE mpterm DROP CONSTRAINT fkorn5mvrebk70b70o3sepp2fwe;
ALTER TABLE ncbitaxonterm DROP CONSTRAINT fk47k37g37jc1e4wdt76ajmn0xk;
ALTER TABLE note_reference RENAME CONSTRAINT fknr8td9rfl6vd6cstukci0e0qq TO note_reference_note_id_fk;
ALTER TABLE note_reference DROP CONSTRAINT note_reference_references_curie_fk;
ALTER INDEX idxk4kbcn96bs4gafx883i9sj7my RENAME TO note_reference_note_index;
ALTER TABLE obiterm DROP CONSTRAINT obiterm_curie_fk;
ALTER TABLE ontologyterm_crossreference DROP CONSTRAINT fk3e1a40poh1ehjk91h42bx7i45;
DROP INDEX ontologyterm_crossreference_ontologyterm_curie_index;
ALTER INDEX ontologyterm_crossreference_crossreferences_id_index RENAME TO ontologyterm_crossreference_crossreferences_index;
ALTER TABLE ontologyterm_definitionurls DROP CONSTRAINT fknhkhso5kmei3t37mkhodkkfgt;
DROP INDEX idx171k63a40d8huvbhohveql7so;
ALTER TABLE ontologyterm_isa_ancestor_descendant DROP CONSTRAINT ontologyterm_ancestor_descendant_pkey;
ALTER TABLE ontologyterm_isa_ancestor_descendant DROP CONSTRAINT fkh6pn8ibta2l7jnov2ds2dqyyt;
ALTER TABLE ontologyterm_isa_ancestor_descendant DROP CONSTRAINT fk62tk8kyfxk80w7n06w0d4o5yf;
DROP INDEX idxll2agbrj7gqreke3x7hr8wvi8;
DROP INDEX idxss79m7jisaqcm3kfq5r7gro16;
ALTER TABLE ontologyterm_isa_parent_children DROP CONSTRAINT ontologyterm_parent_children_pkey;
ALTER TABLE ontologyterm_isa_parent_children DROP CONSTRAINT fkhjjhjxsp6gacmykm0bwijv0tj;
ALTER TABLE ontologyterm_isa_parent_children DROP CONSTRAINT fkqrefoml52l7b5nr5w3diqr5er;
DROP INDEX idx1wx6c7akkhro1m34rawo283t0;
DROP INDEX idx91kybf28ecbonyxlh4s46c756;
ALTER TABLE ontologyterm_secondaryidentifiers DROP CONSTRAINT fkpkg5jfw6wypf4v43bpb4ergu7;
DROP INDEX idxsvjjbf5eugfrbue5yo4jgarpn;
ALTER TABLE ontologyterm_subsets DROP CONSTRAINT fkchq4ex53obwegdhgxrovd5r53;
DROP INDEX idxips7lcqafkikxweue2p0h13t9;
ALTER TABLE ontologyterm_synonym RENAME CONSTRAINT fk4uyg8s1tkgg3vp1cb8dn3vyvr TO ontologyterm_synonym_synonyms_id_fk;
ALTER TABLE ontologyterm_synonym DROP CONSTRAINT fkjf8xunyry3dy9njpqb01tvjsr;
DROP INDEX ontologyterm_synonym_ontologyterm_curie_index;
ALTER TABLE patoterm DROP CONSTRAINT patoterm_curie_fk;
ALTER TABLE phenotypeterm DROP CONSTRAINT fk4ymq8h2kdhq6ix6sfb4q4fn7a;
ALTER TABLE pwterm DROP CONSTRAINT pwterm_curie_fk;
ALTER INDEX reagent_secondaryidentifiers_reagent_id_index RENAME TO reagent_secondaryidentifiers_reagent_index;
ALTER TABLE reference DROP CONSTRAINT fk17o77er2650ydtr1dhtd0y5kn;
ALTER TABLE reference_crossreference DROP CONSTRAINT reference_crossreference_reference_curie_fk;
DROP INDEX idx5f73olsmf7f70k9nimewmv2ov;
ALTER INDEX reference_crossreference_crossreferences_id_index RENAME TO reference_crossreference_crossreferences_index;
DROP INDEX idx8o0l1xsm13k7qe0btnlr0x32j;
ALTER TABLE roterm DROP CONSTRAINT fkyqhfu00n2xcrfg2w4iv9wwx8;
ALTER TABLE rsterm DROP CONSTRAINT rsterm_curie_fk;
ALTER TABLE singlereferenceassociation DROP CONSTRAINT singlereferenceassociation_singlereference_curie_fk;
DROP INDEX singlereferenceassociation_singlereference_index;
ALTER TABLE slotannotation_informationcontententity DROP CONSTRAINT slotannotation_informationcontententity_evidence_curie_fk;
DROP INDEX slotannotation_informationcontententity_evidence_curie_index;
ALTER INDEX slotannotation_informationcontententity_slotannotation_id_index RENAME TO slotannotation_informationcontententity_slotannotation_index;
ALTER TABLE soterm DROP CONSTRAINT fkri7tkc9slvpex9v83peovegyt;
ALTER TABLE species DROP CONSTRAINT species_taxon_curie_fk;
ALTER TABLE stageterm DROP CONSTRAINT fkas58x03rc132q00y838dv1gsb;
ALTER TABLE uberonterm DROP CONSTRAINT uberonterm_curie_fk;
ALTER TABLE variant DROP CONSTRAINT variant_curie_fk;
ALTER TABLE variant DROP CONSTRAINT variant_sourcegeneralconsequence_curie_fk;
ALTER TABLE variant DROP CONSTRAINT variant_varianttype_curie_fk;
DROP INDEX variant_sourcegeneralconsequence_index;
DROP INDEX variant_varianttype_index;
ALTER TABLE variant_note DROP CONSTRAINT variant_note_variant_curie_fk;
DROP INDEX variant_note_variant_curie_index;
ALTER INDEX variant_note_relatednotes_id_index RENAME TO variant_note_relatednotes_index;
ALTER TABLE vtterm DROP CONSTRAINT vtterm_curie_fk;
ALTER TABLE wbbtterm DROP CONSTRAINT fkqnxqrnadcxojeti2ienobdqh0;
ALTER TABLE wblsterm DROP CONSTRAINT fk4k9uvngmwim574bm5mu5q4203;
ALTER TABLE wbphenotypeterm DROP CONSTRAINT fkhonuwqm6g91le1xigmik3yrwl;
ALTER TABLE xbaterm DROP CONSTRAINT fkcnuymf0pvlgwcfd918o4pgs5n;
ALTER TABLE xbedterm DROP CONSTRAINT fkc0dct519510hodhd9d7phfq6g;
ALTER TABLE xbsterm DROP CONSTRAINT fkn8tvxj5qdpjssxjl9jneqst92;
ALTER TABLE xcoterm DROP CONSTRAINT fk35ywtb8qiadqbwsb706ebu81c;
ALTER TABLE xpoterm DROP CONSTRAINT fkqeoygtsa6sf94gw089ugocoph;
ALTER TABLE xsmoterm DROP CONSTRAINT fk36v85u2ghsukqljkkh1jxmtlx;
ALTER TABLE zecoterm DROP CONSTRAINT fkqd3f6hcopl67fwai6viq07t88;
ALTER TABLE zfaterm DROP CONSTRAINT fk572s3xiqi0y4gjblq8xjyk3f7;
ALTER TABLE zfsterm DROP CONSTRAINT fknkrcnh3l23ol126v9w61nk079;
ALTER TABLE affectedgenomicmodel DROP CONSTRAINT affectedgenomicmodel_pkey;
ALTER TABLE allele DROP CONSTRAINT allele_pkey;
ALTER TABLE anatomicalterm DROP CONSTRAINT anatomicalterm_pkey;
ALTER TABLE apoterm DROP CONSTRAINT apoterm_pkey;
ALTER TABLE atpterm DROP CONSTRAINT atpterm_pkey;
ALTER TABLE biologicalentity DROP CONSTRAINT biologicalentity_pkey;
ALTER TABLE biologicalentity ALTER COLUMN curie DROP NOT NULL;
ALTER TABLE bspoterm DROP CONSTRAINT bspoterm_pkey;
ALTER TABLE chebiterm DROP CONSTRAINT chebiterm_pkey;
ALTER TABLE chemicalterm DROP CONSTRAINT chemicalterm_pkey;
ALTER TABLE clterm DROP CONSTRAINT clterm_pkey;
ALTER TABLE cmoterm DROP CONSTRAINT cmoterm_pkey;
ALTER TABLE daoterm DROP CONSTRAINT daoterm_pkey;
ALTER TABLE doterm DROP CONSTRAINT doterm_pkey;
ALTER TABLE dpoterm DROP CONSTRAINT dpoterm_pkey;
ALTER TABLE ecoterm DROP CONSTRAINT ecoterm_pkey;
ALTER TABLE emapaterm DROP CONSTRAINT emapaterm_pkey;
ALTER TABLE experimentalconditionontologyterm DROP CONSTRAINT experimentalconditionontologyterm_pkey;
ALTER TABLE fbdvterm DROP CONSTRAINT IF EXISTS fbdvterm_pkey;
ALTER TABLE gene DROP CONSTRAINT gene_pkey;
ALTER TABLE genomicentity DROP CONSTRAINT genomicentity_pkey;
ALTER TABLE goterm DROP CONSTRAINT goterm_pkey;
ALTER TABLE hpterm DROP CONSTRAINT hpterm_pkey;
ALTER TABLE informationcontententity DROP CONSTRAINT informationcontententity_pkey;
ALTER TABLE materm DROP CONSTRAINT materm_pkey;
ALTER TABLE miterm DROP CONSTRAINT miterm_pkey;
ALTER TABLE mmoterm DROP CONSTRAINT mmoterm_pkey;
ALTER TABLE mmusdvterm DROP CONSTRAINT IF EXISTS mmusdvterm_pkey;
ALTER TABLE modterm DROP CONSTRAINT modterm_pkey;
ALTER TABLE molecule DROP CONSTRAINT molecule_pkey;
ALTER TABLE mpathterm DROP CONSTRAINT mpathterm_pkey;
ALTER TABLE mpterm DROP CONSTRAINT mpterm_pkey;
ALTER TABLE ncbitaxonterm DROP CONSTRAINT ncbitaxonterm_pkey;
ALTER TABLE obiterm DROP CONSTRAINT obiterm_pkey;
ALTER TABLE ontologyterm DROP CONSTRAINT ontologyterm_pkey;
ALTER TABLE patoterm DROP CONSTRAINT patoterm_pkey;
ALTER TABLE phenotypeterm DROP CONSTRAINT phenotypeterm_pkey;
ALTER TABLE pwterm DROP CONSTRAINT pwterm_pkey;
ALTER TABLE reference DROP CONSTRAINT reference_pkey;
ALTER TABLE roterm DROP CONSTRAINT roterm_pkey;
ALTER TABLE rsterm DROP CONSTRAINT rsterm_pkey;
ALTER TABLE soterm DROP CONSTRAINT soterm_pkey;
ALTER TABLE stageterm DROP CONSTRAINT stageterm_pkey;
ALTER TABLE uberonterm DROP CONSTRAINT uberonterm_pkey;
ALTER TABLE variant DROP CONSTRAINT variant_pkey;
ALTER TABLE vtterm DROP CONSTRAINT vtterm_pkey;
ALTER TABLE wbbtterm DROP CONSTRAINT wbbtterm_pkey;
ALTER TABLE wblsterm DROP CONSTRAINT wblsterm_pkey;
ALTER TABLE wbphenotypeterm DROP CONSTRAINT wbphenotypeterm_pkey;
ALTER TABLE xbaterm DROP CONSTRAINT xbaterm_pkey;
ALTER TABLE xbedterm DROP CONSTRAINT xbedterm_pkey;
ALTER TABLE xbsterm DROP CONSTRAINT xbsterm_pkey;
ALTER TABLE xcoterm DROP CONSTRAINT xcoterm_pkey;
ALTER TABLE xpoterm DROP CONSTRAINT xpoterm_pkey;
ALTER TABLE xsmoterm DROP CONSTRAINT xsmoterm_pkey;
ALTER TABLE zecoterm DROP CONSTRAINT zecoterm_pkey;
ALTER TABLE zfaterm DROP CONSTRAINT zfaterm_pkey;
ALTER TABLE zfsterm DROP CONSTRAINT zfsterm_pkey;
-- Create sequences
CREATE SEQUENCE biologicalentity_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
CREATE SEQUENCE informationcontententity_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
CREATE SEQUENCE ontologyterm_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
-- Add id equivalents of curie columns
ALTER TABLE affectedgenomicmodel ADD COLUMN id bigint;
ALTER TABLE agmdiseaseannotation ADD COLUMN inferredallele_id bigint;
ALTER TABLE agmdiseaseannotation ADD COLUMN inferredgene_id bigint;
ALTER TABLE agmdiseaseannotation ADD COLUMN assertedallele_id bigint;
ALTER TABLE agmdiseaseannotation ADD COLUMN diseaseannotationsubject_id bigint;
ALTER TABLE agmdiseaseannotation_gene ADD COLUMN assertedgenes_id bigint;
ALTER TABLE allele ADD COLUMN id bigint;
ALTER TABLE allele_note ADD COLUMN allele_id bigint;
ALTER TABLE allele_reference ADD COLUMN allele_id bigint;
ALTER TABLE allele_reference ADD COLUMN references_id bigint;
ALTER TABLE alleledatabasestatusslotannotation ADD COLUMN singleallele_id bigint;
ALTER TABLE allelediseaseannotation ADD COLUMN inferredgene_id bigint;
ALTER TABLE allelediseaseannotation ADD COLUMN diseaseannotationsubject_id bigint;
ALTER TABLE allelediseaseannotation_gene ADD COLUMN assertedgenes_id bigint;
ALTER TABLE allelefullnameslotannotation ADD COLUMN singleallele_id bigint;
ALTER TABLE allelefunctionalimpactslotannotation ADD COLUMN singleallele_id bigint;
ALTER TABLE allelefunctionalimpactslotannotation ADD COLUMN phenotypeterm_id bigint;
ALTER TABLE allelegeneassociation ADD COLUMN alleleassociationsubject_id bigint;
ALTER TABLE allelegeneassociation ADD COLUMN allelegeneassociationobject_id bigint;
ALTER TABLE allelegenomicentityassociation ADD COLUMN evidencecode_id bigint;
ALTER TABLE allelegermlinetransmissionstatusslotannotation ADD COLUMN singleallele_id bigint;
ALTER TABLE alleleinheritancemodeslotannotation ADD COLUMN singleallele_id bigint;
ALTER TABLE alleleinheritancemodeslotannotation ADD COLUMN phenotypeterm_id bigint;
ALTER TABLE allelemutationtypeslotannotation ADD COLUMN singleallele_id bigint;
ALTER TABLE allelemutationtypeslotannotation_soterm ADD COLUMN mutationtypes_id bigint;
ALTER TABLE allelenomenclatureeventslotannotation ADD COLUMN singleallele_id bigint;
ALTER TABLE allelesecondaryidslotannotation ADD COLUMN singleallele_id bigint;
ALTER TABLE allelesymbolslotannotation ADD COLUMN singleallele_id bigint;
ALTER TABLE allelesynonymslotannotation ADD COLUMN singleallele_id bigint;
ALTER TABLE anatomicalterm ADD COLUMN id bigint;
ALTER TABLE apoterm ADD COLUMN id bigint;
ALTER TABLE atpterm ADD COLUMN id bigint;
ALTER TABLE biologicalentity ADD COLUMN id bigint;
ALTER TABLE biologicalentity ADD COLUMN modentityid varchar(255);
ALTER TABLE biologicalentity ADD COLUMN modinternalid varchar(255);
ALTER TABLE biologicalentity ADD COLUMN taxon_id bigint;
ALTER TABLE bspoterm ADD COLUMN id bigint;
ALTER TABLE chebiterm ADD COLUMN id bigint;
ALTER TABLE chemicalterm ADD COLUMN id bigint;
ALTER TABLE clterm ADD COLUMN id bigint;
ALTER TABLE cmoterm ADD COLUMN id bigint;
ALTER TABLE conditionrelation ADD COLUMN singlereference_id bigint;
ALTER TABLE construct_reference ADD COLUMN references_id bigint;
ALTER TABLE constructcomponentslotannotation ADD COLUMN taxon_id bigint;
ALTER TABLE constructgenomicentityassociation ADD COLUMN constructgenomicentityassociationobject_id bigint;
ALTER TABLE daoterm ADD COLUMN id bigint;
ALTER TABLE diseaseannotation ADD COLUMN diseaseannotationobject_id bigint;
ALTER TABLE diseaseannotation_biologicalentity ADD COLUMN diseasegeneticmodifiers_id bigint;
ALTER TABLE diseaseannotation_ecoterm ADD COLUMN evidencecodes_id bigint;
ALTER TABLE diseaseannotation_gene ADD COLUMN with_id bigint;
ALTER TABLE doterm ADD COLUMN id bigint;
ALTER TABLE dpoterm ADD COLUMN id bigint;
ALTER TABLE ecoterm ADD COLUMN id bigint;
ALTER TABLE emapaterm ADD COLUMN id bigint;
ALTER TABLE evidenceassociation_informationcontententity ADD COLUMN evidence_id bigint;
ALTER TABLE experimentalcondition ADD COLUMN conditionanatomy_id bigint;
ALTER TABLE experimentalcondition ADD COLUMN conditionchemical_id bigint;
ALTER TABLE experimentalcondition ADD COLUMN conditionclass_id bigint;
ALTER TABLE experimentalcondition ADD COLUMN conditiongeneontology_id bigint;
ALTER TABLE experimentalcondition ADD COLUMN conditionid_id bigint;
ALTER TABLE experimentalcondition ADD COLUMN conditiontaxon_id bigint;
ALTER TABLE experimentalconditionontologyterm ADD COLUMN id bigint;
ALTER TABLE fbdvterm ADD COLUMN id bigint;
ALTER TABLE gene ADD COLUMN id bigint;
ALTER TABLE gene ADD COLUMN genetype_id bigint;
ALTER TABLE genediseaseannotation ADD COLUMN sgdstrainbackground_id bigint;
ALTER TABLE genediseaseannotation ADD COLUMN diseaseannotationsubject_id bigint;
ALTER TABLE genefullnameslotannotation ADD COLUMN singlegene_id bigint;
ALTER TABLE genesecondaryidslotannotation ADD COLUMN singlegene_id bigint;
ALTER TABLE genesymbolslotannotation ADD COLUMN singlegene_id bigint;
ALTER TABLE genesynonymslotannotation ADD COLUMN singlegene_id bigint;
ALTER TABLE genesystematicnameslotannotation ADD COLUMN singlegene_id bigint;
ALTER TABLE genetogeneorthology ADD COLUMN subjectgene_id bigint;
ALTER TABLE genetogeneorthology ADD COLUMN objectgene_id bigint;
ALTER TABLE genetogeneorthologycurated ADD COLUMN singlereference_id bigint;
ALTER TABLE genetogeneorthologycurated ADD COLUMN evidencecode_id bigint;
ALTER TABLE genomicentity ADD COLUMN id bigint;
ALTER TABLE genomicentity_crossreference ADD COLUMN genomicentity_id bigint;
ALTER TABLE goterm ADD COLUMN id bigint;
ALTER TABLE hpterm ADD COLUMN id bigint;
ALTER TABLE informationcontententity ADD COLUMN id bigint;
ALTER TABLE materm ADD COLUMN id bigint;
ALTER TABLE miterm ADD COLUMN id bigint;
ALTER TABLE mmoterm ADD COLUMN id bigint;
ALTER TABLE mmusdvterm ADD COLUMN id bigint;
ALTER TABLE modterm ADD COLUMN id bigint;
ALTER TABLE molecule ADD COLUMN id bigint;
ALTER TABLE mpathterm ADD COLUMN id bigint;
ALTER TABLE mpterm ADD COLUMN id bigint;
ALTER TABLE ncbitaxonterm ADD COLUMN id bigint;
ALTER TABLE note_reference ADD COLUMN references_id bigint;
ALTER TABLE obiterm ADD COLUMN id bigint;
ALTER TABLE ontologyterm ADD COLUMN id bigint;
ALTER TABLE ontologyterm_crossreference ADD COLUMN ontologyterm_id bigint;
ALTER TABLE ontologyterm_definitionurls ADD COLUMN ontologyterm_id bigint;
ALTER TABLE ontologyterm_isa_ancestor_descendant ADD COLUMN isadescendants_id bigint;
ALTER TABLE ontologyterm_isa_ancestor_descendant ADD COLUMN isaancestors_id bigint;
ALTER TABLE ontologyterm_isa_parent_children ADD COLUMN isachildren_id bigint;
ALTER TABLE ontologyterm_isa_parent_children ADD COLUMN isaparents_id bigint;
ALTER TABLE ontologyterm_secondaryidentifiers ADD COLUMN ontologyterm_id bigint;
ALTER TABLE ontologyterm_subsets ADD COLUMN ontologyterm_id bigint;
ALTER TABLE ontologyterm_synonym ADD COLUMN ontologyterm_id bigint;
ALTER TABLE patoterm ADD COLUMN id bigint;
ALTER TABLE phenotypeterm ADD COLUMN id bigint;
ALTER TABLE pwterm ADD COLUMN id bigint;
ALTER TABLE reference ADD COLUMN id bigint;
ALTER TABLE reference_crossreference ADD COLUMN reference_id bigint;
ALTER TABLE roterm ADD COLUMN id bigint;
ALTER TABLE rsterm ADD COLUMN id bigint;
ALTER TABLE singlereferenceassociation ADD COLUMN singlereference_id bigint;
ALTER TABLE slotannotation_informationcontententity ADD COLUMN evidence_id bigint;
ALTER TABLE soterm ADD COLUMN id bigint;
ALTER TABLE species ADD COLUMN taxon_id bigint;
ALTER TABLE stageterm ADD COLUMN id bigint;
ALTER TABLE uberonterm ADD COLUMN id bigint;
ALTER TABLE variant ADD COLUMN id bigint;
ALTER TABLE variant ADD COLUMN varianttype_id bigint;
ALTER TABLE variant ADD COLUMN sourcegeneralconsequence_id bigint;
ALTER TABLE variant_note ADD COLUMN variant_id bigint;
ALTER TABLE vtterm ADD COLUMN id bigint;
ALTER TABLE wbbtterm ADD COLUMN id bigint;
ALTER TABLE wblsterm ADD COLUMN id bigint;
ALTER TABLE wbphenotypeterm ADD COLUMN id bigint;
ALTER TABLE xbaterm ADD COLUMN id bigint;
ALTER TABLE xbedterm ADD COLUMN id bigint;
ALTER TABLE xbsterm ADD COLUMN id bigint;
ALTER TABLE xcoterm ADD COLUMN id bigint;
ALTER TABLE xpoterm ADD COLUMN id bigint;
ALTER TABLE xsmoterm ADD COLUMN id bigint;
ALTER TABLE zecoterm ADD COLUMN id bigint;
ALTER TABLE zfaterm ADD COLUMN id bigint;
ALTER TABLE zfsterm ADD COLUMN id bigint;
-- Move data around
UPDATE biologicalentity SET id = nextval('biologicalentity_seq');
UPDATE biologicalentity SET modentityid = curie;
UPDATE biologicalentity SET curie = null;
ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_pkey PRIMARY KEY (id);
ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_curie_uk UNIQUE (curie);
ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_modentityid_uk UNIQUE (modentityid);
ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_modinternalid_uk UNIQUE (modinternalid);
CREATE INDEX biologicalentity_modentityid_index ON biologicalentity USING btree (modentityid);
UPDATE informationcontententity SET id = nextval('informationcontententity_seq');
ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_curie_uk UNIQUE (curie);
ALTER TABLE informationcontententity ADD CONSTRAINT informationcontententity_pkey PRIMARY KEY (id);
UPDATE ontologyterm SET id = nextval('ontologyterm_seq');
ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_curie_uk UNIQUE (curie);
ALTER TABLE ontologyterm ADD CONSTRAINT ontologyterm_pkey PRIMARY KEY (id);
UPDATE affectedgenomicmodel t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid;
UPDATE agmdiseaseannotation t SET inferredallele_id = b.id FROM biologicalentity b WHERE t.inferredallele_curie = b.modentityid;
UPDATE agmdiseaseannotation t SET assertedallele_id = b.id FROM biologicalentity b WHERE t.assertedallele_curie = b.modentityid;
UPDATE agmdiseaseannotation t SET inferredgene_id = b.id FROM biologicalentity b WHERE t.inferredgene_curie = b.modentityid;
UPDATE agmdiseaseannotation t SET diseaseannotationsubject_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid;
UPDATE agmdiseaseannotation_gene t SET assertedgenes_id = b.id FROM biologicalentity b WHERE t.assertedgenes_curie = b.modentityid;
UPDATE allele t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid;
UPDATE allele_note t SET allele_id = b.id FROM biologicalentity b WHERE t.allele_curie = b.modentityid;
UPDATE allele_reference t SET allele_id = b.id FROM biologicalentity b WHERE t.allele_curie = b.modentityid;
UPDATE allele_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie;
UPDATE alleledatabasestatusslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid;
UPDATE allelediseaseannotation t SET inferredgene_id = b.id FROM biologicalentity b WHERE t.inferredgene_curie = b.modentityid;
UPDATE allelediseaseannotation t SET diseaseannotationsubject_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid;
UPDATE allelediseaseannotation_gene t SET assertedgenes_id = b.id FROM biologicalentity b WHERE t.assertedgenes_curie = b.modentityid;
UPDATE allelefullnameslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid;
UPDATE allelefunctionalimpactslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid;
UPDATE allelefunctionalimpactslotannotation t SET phenotypeterm_id = o.id FROM ontologyterm o WHERE t.phenotypeterm_curie = o.curie;
UPDATE allelegeneassociation t SET alleleassociationsubject_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid;
UPDATE allelegeneassociation t SET allelegeneassociationobject_id = b.id FROM biologicalentity b WHERE t.object_curie = b.modentityid;
UPDATE allelegenomicentityassociation t SET evidencecode_id = o.id FROM ontologyterm o WHERE t.evidencecode_curie = o.curie;
UPDATE allelegermlinetransmissionstatusslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid;
UPDATE alleleinheritancemodeslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid;
UPDATE alleleinheritancemodeslotannotation t SET phenotypeterm_id = o.id FROM ontologyterm o WHERE t.phenotypeterm_curie = o.curie;
UPDATE allelemutationtypeslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid;
UPDATE allelemutationtypeslotannotation_soterm t SET mutationtypes_id = o.id FROM ontologyterm o WHERE t.mutationtypes_curie = o.curie;
UPDATE allelenomenclatureeventslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid;
UPDATE allelesecondaryidslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid;
UPDATE allelesymbolslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid;
UPDATE allelesynonymslotannotation t SET singleallele_id = b.id FROM biologicalentity b WHERE t.singleallele_curie = b.modentityid;
UPDATE anatomicalterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE apoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE atpterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE biologicalentity t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid;
UPDATE biologicalentity t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie;
UPDATE bspoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE chebiterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE chemicalterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE clterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE cmoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE conditionrelation t SET singlereference_id = i.id FROM informationcontententity i WHERE t.singlereference_curie = i.curie;
UPDATE construct_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie;
UPDATE constructcomponentslotannotation t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie;
UPDATE constructgenomicentityassociation t SET constructgenomicentityassociationobject_id = b.id FROM biologicalentity b WHERE t.object_curie = b.modentityid;
UPDATE daoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE diseaseannotation t SET diseaseannotationobject_id = o.id FROM ontologyterm o WHERE t.object_curie = o.curie;
UPDATE diseaseannotation_biologicalentity t SET diseasegeneticmodifiers_id = b.id FROM biologicalentity b WHERE t.diseasegeneticmodifiers_curie = b.modentityid;
UPDATE diseaseannotation_ecoterm t SET evidencecodes_id = o.id FROM ontologyterm o WHERE t.evidencecodes_curie = o.curie;
UPDATE diseaseannotation_gene t SET with_id = b.id FROM biologicalentity b WHERE t.with_curie = b.modentityid;
UPDATE doterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE dpoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE ecoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE emapaterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE evidenceassociation_informationcontententity t SET evidence_id = i.id FROM informationcontententity i WHERE t.evidence_curie = i.curie;
UPDATE experimentalcondition t SET conditionanatomy_id = o.id FROM ontologyterm o WHERE t.conditionanatomy_curie = o.curie;
UPDATE experimentalcondition t SET conditionchemical_id = o.id FROM ontologyterm o WHERE t.conditionchemical_curie = o.curie;
UPDATE experimentalcondition t SET conditionclass_id = o.id FROM ontologyterm o WHERE t.conditionclass_curie = o.curie;
UPDATE experimentalcondition t SET conditiongeneontology_id = o.id FROM ontologyterm o WHERE t.conditiongeneontology_curie = o.curie;
UPDATE experimentalcondition t SET conditionid_id = o.id FROM ontologyterm o WHERE t.conditionid_curie = o.curie;
UPDATE experimentalcondition t SET conditiontaxon_id = o.id FROM ontologyterm o WHERE t.conditiontaxon_curie = o.curie;
UPDATE experimentalconditionontologyterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE fbdvterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE gene t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid;
UPDATE gene t SET genetype_id = o.id FROM ontologyterm o WHERE t.genetype_curie = o.curie;
UPDATE genediseaseannotation t SET sgdstrainbackground_id = b.id FROM biologicalentity b WHERE t.sgdstrainbackground_curie = b.modentityid;
UPDATE genediseaseannotation t SET diseaseannotationsubject_id = b.id FROM biologicalentity b WHERE t.subject_curie = b.modentityid;
UPDATE genefullnameslotannotation t SET singlegene_id = b.id FROM biologicalentity b WHERE t.singlegene_curie = b.modentityid;
UPDATE genesecondaryidslotannotation t SET singlegene_id = b.id FROM biologicalentity b WHERE t.singlegene_curie = b.modentityid;
UPDATE genesymbolslotannotation t SET singlegene_id = b.id FROM biologicalentity b WHERE t.singlegene_curie = b.modentityid;
UPDATE genesynonymslotannotation t SET singlegene_id = b.id FROM biologicalentity b WHERE t.singlegene_curie = b.modentityid;
UPDATE genesystematicnameslotannotation t SET singlegene_id = b.id FROM biologicalentity b WHERE t.singlegene_curie = b.modentityid;
UPDATE genetogeneorthology t SET subjectgene_id = b.id FROM biologicalentity b WHERE t.subjectgene_curie = b.modentityid;
UPDATE genetogeneorthology t SET objectgene_id = b.id FROM biologicalentity b WHERE t.objectgene_curie = b.modentityid;
UPDATE genetogeneorthologycurated t SET evidencecode_id = o.id FROM ontologyterm o WHERE t.evidencecode_curie = o.curie;
UPDATE genetogeneorthologycurated t SET singlereference_id = i.id FROM informationcontententity i WHERE t.singlereference_curie = i.curie;
UPDATE genomicentity t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid;
UPDATE genomicentity_crossreference t SET genomicentity_id = b.id FROM biologicalentity b WHERE t.genomicentity_curie = b.modentityid;
UPDATE goterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE hpterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE materm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE miterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE mmoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE mmusdvterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE modterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE molecule t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE mpathterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE mpterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE ncbitaxonterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE note_reference t SET references_id = i.id FROM informationcontententity i WHERE t.references_curie = i.curie;
UPDATE obiterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE ontologyterm_crossreference t SET ontologyterm_id = o.id FROM ontologyterm o WHERE t.ontologyterm_curie = o.curie;
UPDATE ontologyterm_definitionurls t SET ontologyterm_id = o.id FROM ontologyterm o WHERE t.ontologyterm_curie = o.curie;
UPDATE ontologyterm_isa_ancestor_descendant t SET isadescendants_id = o.id FROM ontologyterm o WHERE t.isadescendants_curie = o.curie;
UPDATE ontologyterm_isa_ancestor_descendant t SET isaancestors_id = o.id FROM ontologyterm o WHERE t.isaancestors_curie = o.curie;
UPDATE ontologyterm_isa_parent_children t SET isachildren_id = o.id FROM ontologyterm o WHERE t.isachildren_curie = o.curie;
UPDATE ontologyterm_isa_parent_children t SET isaparents_id = o.id FROM ontologyterm o WHERE t.isaparents_curie = o.curie;
UPDATE ontologyterm_secondaryidentifiers t SET ontologyterm_id = o.id FROM ontologyterm o WHERE t.ontologyterm_curie = o.curie;
UPDATE ontologyterm_subsets t SET ontologyterm_id = o.id FROM ontologyterm o WHERE t.ontologyterm_curie = o.curie;
UPDATE ontologyterm_synonym t SET ontologyterm_id = o.id FROM ontologyterm o WHERE t.ontologyterm_curie = o.curie;
UPDATE patoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE phenotypeterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE pwterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE reference t SET id = i.id FROM informationcontententity i WHERE t.curie = i.curie;
UPDATE reference_crossreference t SET reference_id = i.id FROM informationcontententity i WHERE t.reference_curie = i.curie;
UPDATE roterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE rsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE soterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE singlereferenceassociation t SET singlereference_id = i.id FROM informationcontententity i WHERE t.singlereference_curie = i.curie;
UPDATE slotannotation_informationcontententity t SET evidence_id = i.id FROM informationcontententity i WHERE t.evidence_curie = i.curie;
UPDATE species t SET taxon_id = o.id FROM ontologyterm o WHERE t.taxon_curie = o.curie;
UPDATE stageterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE uberonterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE variant t SET id = b.id FROM biologicalentity b WHERE t.curie = b.modentityid;
UPDATE variant t SET varianttype_id = o.id FROM ontologyterm o WHERE t.varianttype_curie = o.curie;
UPDATE variant t SET sourcegeneralconsequence_id = o.id FROM ontologyterm o WHERE t.sourcegeneralconsequence_curie = o.curie;
UPDATE variant_note t SET variant_id = b.id FROM biologicalentity b WHERE t.variant_curie = b.modentityid;
UPDATE vtterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE wbbtterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE wblsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE wbphenotypeterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE xbaterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE xbedterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE xbsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE xcoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE xpoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE xsmoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE zecoterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE zfaterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
UPDATE zfsterm t SET id = o.id FROM ontologyterm o WHERE t.curie = o.curie;
ALTER TABLE affectedgenomicmodel DROP COLUMN curie;
ALTER TABLE agmdiseaseannotation DROP COLUMN inferredallele_curie;
ALTER TABLE agmdiseaseannotation DROP COLUMN inferredgene_curie;
ALTER TABLE agmdiseaseannotation DROP COLUMN assertedallele_curie;
ALTER TABLE agmdiseaseannotation DROP COLUMN subject_curie;
ALTER TABLE agmdiseaseannotation_gene DROP COLUMN assertedgenes_curie;
ALTER TABLE allele DROP COLUMN curie;
ALTER TABLE allele_note DROP COLUMN allele_curie;
ALTER TABLE allele_reference DROP COLUMN allele_curie;
ALTER TABLE allele_reference DROP COLUMN references_curie;
ALTER TABLE alleledatabasestatusslotannotation DROP COLUMN singleallele_curie;
ALTER TABLE allelediseaseannotation DROP COLUMN inferredgene_curie;
ALTER TABLE allelediseaseannotation DROP COLUMN subject_curie;
ALTER TABLE allelediseaseannotation_gene DROP COLUMN assertedgenes_curie;
ALTER TABLE allelefullnameslotannotation DROP COLUMN singleallele_curie;
ALTER TABLE allelefunctionalimpactslotannotation DROP COLUMN singleallele_curie;
ALTER TABLE allelefunctionalimpactslotannotation DROP COLUMN phenotypeterm_curie;
ALTER TABLE allelegeneassociation DROP COLUMN subject_curie;
ALTER TABLE allelegeneassociation DROP COLUMN object_curie;
ALTER TABLE allelegenomicentityassociation DROP COLUMN evidencecode_curie;
ALTER TABLE allelegermlinetransmissionstatusslotannotation DROP COLUMN singleallele_curie;
ALTER TABLE alleleinheritancemodeslotannotation DROP COLUMN singleallele_curie;
ALTER TABLE alleleinheritancemodeslotannotation DROP COLUMN phenotypeterm_curie;
ALTER TABLE allelemutationtypeslotannotation DROP COLUMN singleallele_curie;
ALTER TABLE allelemutationtypeslotannotation_soterm DROP COLUMN mutationtypes_curie;
ALTER TABLE allelenomenclatureeventslotannotation DROP COLUMN singleallele_curie;
ALTER TABLE allelesecondaryidslotannotation DROP COLUMN singleallele_curie;
ALTER TABLE allelesymbolslotannotation DROP COLUMN singleallele_curie;
ALTER TABLE allelesynonymslotannotation DROP COLUMN singleallele_curie;
ALTER TABLE anatomicalterm DROP COLUMN curie;
ALTER TABLE apoterm DROP COLUMN curie;
ALTER TABLE atpterm DROP COLUMN curie;
ALTER TABLE biologicalentity DROP COLUMN taxon_curie;
ALTER TABLE bspoterm DROP COLUMN curie;
ALTER TABLE chebiterm DROP COLUMN curie;
ALTER TABLE chemicalterm DROP COLUMN curie;
ALTER TABLE clterm DROP COLUMN curie;
ALTER TABLE cmoterm DROP COLUMN curie;
ALTER TABLE conditionrelation DROP COLUMN singlereference_curie;
ALTER TABLE construct_reference DROP COLUMN references_curie;
ALTER TABLE constructcomponentslotannotation DROP COLUMN taxon_curie;
ALTER TABLE constructgenomicentityassociation DROP COLUMN object_curie;
ALTER TABLE daoterm DROP COLUMN curie;
ALTER TABLE diseaseannotation DROP COLUMN object_curie;
ALTER TABLE diseaseannotation_biologicalentity DROP COLUMN diseasegeneticmodifiers_curie;
ALTER TABLE diseaseannotation_ecoterm DROP COLUMN evidencecodes_curie;
ALTER TABLE diseaseannotation_gene DROP COLUMN with_curie;
ALTER TABLE doterm DROP COLUMN curie;
ALTER TABLE dpoterm DROP COLUMN curie;
ALTER TABLE ecoterm DROP COLUMN curie;
ALTER TABLE emapaterm DROP COLUMN curie;
ALTER TABLE evidenceassociation_informationcontententity DROP COLUMN evidence_curie;
ALTER TABLE experimentalcondition DROP COLUMN conditionanatomy_curie;
ALTER TABLE experimentalcondition DROP COLUMN conditionchemical_curie;
ALTER TABLE experimentalcondition DROP COLUMN conditionclass_curie;
ALTER TABLE experimentalcondition DROP COLUMN conditiongeneontology_curie;
ALTER TABLE experimentalcondition DROP COLUMN conditionid_curie;
ALTER TABLE experimentalcondition DROP COLUMN conditiontaxon_curie;
ALTER TABLE experimentalconditionontologyterm DROP COLUMN curie;
ALTER TABLE fbdvterm DROP COLUMN curie;
ALTER TABLE gene DROP COLUMN curie;
ALTER TABLE gene DROP COLUMN genetype_curie;
ALTER TABLE genediseaseannotation DROP COLUMN sgdstrainbackground_curie;
ALTER TABLE genediseaseannotation DROP COLUMN subject_curie;
ALTER TABLE genefullnameslotannotation DROP COLUMN singlegene_curie;
ALTER TABLE genesecondaryidslotannotation DROP COLUMN singlegene_curie;
ALTER TABLE genesymbolslotannotation DROP COLUMN singlegene_curie;
ALTER TABLE genesynonymslotannotation DROP COLUMN singlegene_curie;
ALTER TABLE genesystematicnameslotannotation DROP COLUMN singlegene_curie;
ALTER TABLE genetogeneorthology DROP COLUMN subjectgene_curie;
ALTER TABLE genetogeneorthology DROP COLUMN objectgene_curie;
ALTER TABLE genetogeneorthologycurated DROP COLUMN singlereference_curie;
ALTER TABLE genetogeneorthologycurated DROP COLUMN evidencecode_curie;
ALTER TABLE genomicentity DROP COLUMN curie;
ALTER TABLE genomicentity_crossreference DROP COLUMN genomicentity_curie;
ALTER TABLE goterm DROP COLUMN curie;
ALTER TABLE hpterm DROP COLUMN curie;
ALTER TABLE materm DROP COLUMN curie;
ALTER TABLE miterm DROP COLUMN curie;
ALTER TABLE mmoterm DROP COLUMN curie;
ALTER TABLE mmusdvterm DROP COLUMN curie;
ALTER TABLE modterm DROP COLUMN curie;
ALTER TABLE molecule DROP COLUMN curie;
ALTER TABLE mpathterm DROP COLUMN curie;
ALTER TABLE mpterm DROP COLUMN curie;
ALTER TABLE ncbitaxonterm DROP COLUMN curie;
ALTER TABLE note_reference DROP COLUMN references_curie;
ALTER TABLE obiterm DROP COLUMN curie;
ALTER TABLE ontologyterm_crossreference DROP COLUMN ontologyterm_curie;
ALTER TABLE ontologyterm_definitionurls DROP COLUMN ontologyterm_curie;
ALTER TABLE ontologyterm_isa_ancestor_descendant DROP COLUMN isadescendants_curie;
ALTER TABLE ontologyterm_isa_ancestor_descendant DROP COLUMN isaancestors_curie;
ALTER TABLE ontologyterm_isa_parent_children DROP COLUMN isachildren_curie;
ALTER TABLE ontologyterm_isa_parent_children DROP COLUMN isaparents_curie;
ALTER TABLE ontologyterm_secondaryidentifiers DROP COLUMN ontologyterm_curie;
ALTER TABLE ontologyterm_subsets DROP COLUMN ontologyterm_curie;
ALTER TABLE ontologyterm_synonym DROP COLUMN ontologyterm_curie;
ALTER TABLE patoterm DROP COLUMN curie;
ALTER TABLE phenotypeterm DROP COLUMN curie;
ALTER TABLE pwterm DROP COLUMN curie;
ALTER TABLE reference DROP COLUMN curie;
ALTER TABLE reference_crossreference DROP COLUMN reference_curie;
ALTER TABLE roterm DROP COLUMN curie;
ALTER TABLE rsterm DROP COLUMN curie;
ALTER TABLE singlereferenceassociation DROP COLUMN singlereference_curie;
ALTER TABLE slotannotation_informationcontententity DROP COLUMN evidence_curie;
ALTER TABLE soterm DROP COLUMN curie;
ALTER TABLE species DROP COLUMN taxon_curie;
ALTER TABLE stageterm DROP COLUMN curie;
ALTER TABLE uberonterm DROP COLUMN curie;
ALTER TABLE variant DROP COLUMN curie;
ALTER TABLE variant DROP COLUMN varianttype_curie;
ALTER TABLE variant DROP COLUMN sourcegeneralconsequence_curie;
ALTER TABLE variant_note DROP COLUMN variant_curie;
ALTER TABLE vtterm DROP COLUMN curie;
ALTER TABLE wbbtterm DROP COLUMN curie;
ALTER TABLE wblsterm DROP COLUMN curie;
ALTER TABLE wbphenotypeterm DROP COLUMN curie;
ALTER TABLE xbaterm DROP COLUMN curie;
ALTER TABLE xbedterm DROP COLUMN curie;
ALTER TABLE xbsterm DROP COLUMN curie;
ALTER TABLE xcoterm DROP COLUMN curie;
ALTER TABLE xpoterm DROP COLUMN curie;
ALTER TABLE xsmoterm DROP COLUMN curie;
ALTER TABLE zecoterm DROP COLUMN curie;
ALTER TABLE zfaterm DROP COLUMN curie;
ALTER TABLE zfsterm DROP COLUMN curie;
-- Add constraints and indexes
CREATE INDEX experimentalcondition_createdby_index ON experimentalcondition USING btree (createdby_id);
CREATE INDEX experimentalcondition_updatedby_index ON experimentalcondition USING btree (updatedby_id);
CREATE INDEX conditionrelation_createdby_index ON conditionrelation USING btree (createdby_id);
CREATE INDEX conditionrelation_updatedby_index ON conditionrelation USING btree (updatedby_id);
ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_pkey PRIMARY KEY (id);
ALTER TABLE allele ADD CONSTRAINT allele_pkey PRIMARY KEY (id);
ALTER TABLE anatomicalterm ADD CONSTRAINT anatomicalterm_pkey PRIMARY KEY (id);
ALTER TABLE apoterm ADD CONSTRAINT apoterm_pkey PRIMARY KEY (id);
ALTER TABLE atpterm ADD CONSTRAINT atpterm_pkey PRIMARY KEY (id);
ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_pkey PRIMARY KEY (id);
ALTER TABLE chebiterm ADD CONSTRAINT chebiterm_pkey PRIMARY KEY (id);
ALTER TABLE chemicalterm ADD CONSTRAINT chemicalterm_pkey PRIMARY KEY (id);
ALTER TABLE clterm ADD CONSTRAINT clterm_pkey PRIMARY KEY (id);
ALTER TABLE cmoterm ADD CONSTRAINT cmoterm_pkey PRIMARY KEY (id);
ALTER TABLE daoterm ADD CONSTRAINT daoterm_pkey PRIMARY KEY (id);
ALTER TABLE doterm ADD CONSTRAINT doterm_pkey PRIMARY KEY (id);
ALTER TABLE dpoterm ADD CONSTRAINT dpoterm_pkey PRIMARY KEY (id);
ALTER TABLE ecoterm ADD CONSTRAINT ecoterm_pkey PRIMARY KEY (id);
ALTER TABLE emapaterm ADD CONSTRAINT emapaterm_pkey PRIMARY KEY (id);
ALTER TABLE experimentalconditionontologyterm ADD CONSTRAINT experimentalconditionontologyterm_pkey PRIMARY KEY (id);
ALTER TABLE fbdvterm ADD CONSTRAINT fbdvterm_pkey PRIMARY KEY (id);
ALTER TABLE gene ADD CONSTRAINT gene_pkey PRIMARY KEY (id);
ALTER TABLE genomicentity ADD CONSTRAINT genomicentity_pkey PRIMARY KEY (id);
ALTER TABLE goterm ADD CONSTRAINT goterm_pkey PRIMARY KEY (id);
ALTER TABLE hpterm ADD CONSTRAINT hpterm_pkey PRIMARY KEY (id);
ALTER TABLE materm ADD CONSTRAINT materm_pkey PRIMARY KEY (id);
ALTER TABLE miterm ADD CONSTRAINT miterm_pkey PRIMARY KEY (id);
ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_pkey PRIMARY KEY (id);
ALTER TABLE mmusdvterm ADD CONSTRAINT mmusdvterm_pkey PRIMARY KEY (id);
ALTER TABLE modterm ADD CONSTRAINT modterm_pkey PRIMARY KEY (id);
ALTER TABLE molecule ADD CONSTRAINT molecule_pkey PRIMARY KEY (id);
ALTER TABLE mpathterm ADD CONSTRAINT mpathterm_pkey PRIMARY KEY (id);
ALTER TABLE mpterm ADD CONSTRAINT mpterm_pkey PRIMARY KEY (id);
ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_pkey PRIMARY KEY (id);
ALTER TABLE obiterm ADD CONSTRAINT obiterm_pkey PRIMARY KEY (id);
ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_pkey PRIMARY KEY (isachildren_id, isaparents_id);
ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_pkey PRIMARY KEY (isadescendants_id, isaancestors_id);
ALTER TABLE patoterm ADD CONSTRAINT patoterm_pkey PRIMARY KEY (id);
ALTER TABLE phenotypeterm ADD CONSTRAINT phenotypeterm_pkey PRIMARY KEY (id);
ALTER TABLE pwterm ADD CONSTRAINT pwterm_pkey PRIMARY KEY (id);
ALTER TABLE reference ADD CONSTRAINT reference_pkey PRIMARY KEY (id);
ALTER TABLE roterm ADD CONSTRAINT roterm_pkey PRIMARY KEY (id);
ALTER TABLE rsterm ADD CONSTRAINT rsterm_pkey PRIMARY KEY (id);
ALTER TABLE soterm ADD CONSTRAINT soterm_pkey PRIMARY KEY (id);
ALTER TABLE stageterm ADD CONSTRAINT stageterm_pkey PRIMARY KEY (id);
ALTER TABLE uberonterm ADD CONSTRAINT uberonterm_pkey PRIMARY KEY (id);
ALTER TABLE variant ADD CONSTRAINT variant_pkey PRIMARY KEY (id);
ALTER TABLE vtterm ADD CONSTRAINT vtterm_pkey PRIMARY KEY (id);
ALTER TABLE wbbtterm ADD CONSTRAINT wbbtterm_pkey PRIMARY KEY (id);
ALTER TABLE wblsterm ADD CONSTRAINT wblsterm_pkey PRIMARY KEY (id);
ALTER TABLE wbphenotypeterm ADD CONSTRAINT wbphenotypeterm_pkey PRIMARY KEY (id);
ALTER TABLE xbaterm ADD CONSTRAINT xbaterm_pkey PRIMARY KEY (id);
ALTER TABLE xbedterm ADD CONSTRAINT xbedterm_pkey PRIMARY KEY (id);
ALTER TABLE xbsterm ADD CONSTRAINT xbsterm_pkey PRIMARY KEY (id);
ALTER TABLE xcoterm ADD CONSTRAINT xcoterm_pkey PRIMARY KEY (id);
ALTER TABLE xpoterm ADD CONSTRAINT xpoterm_pkey PRIMARY KEY (id);
ALTER TABLE xsmoterm ADD CONSTRAINT xsmoterm_pkey PRIMARY KEY (id);
ALTER TABLE zecoterm ADD CONSTRAINT zecoterm_pkey PRIMARY KEY (id);
ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_pkey PRIMARY KEY (id);
ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_pkey PRIMARY KEY (id);
ALTER TABLE affectedgenomicmodel ADD CONSTRAINT affectedgenomicmodel_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id);
ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_diseaseannotationsubject_id_fk FOREIGN KEY (diseaseannotationsubject_id) REFERENCES affectedgenomicmodel (id);
ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_assertedallele_id_fk FOREIGN KEY (assertedallele_id) REFERENCES allele (id);
ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredallele_id_fk FOREIGN KEY (inferredallele_id) REFERENCES allele (id);
ALTER TABLE agmdiseaseannotation ADD CONSTRAINT agmdiseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id);
ALTER TABLE agmdiseaseannotation_gene ADD CONSTRAINT agmdiseaseannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id);
CREATE INDEX agmdiseaseannotation_diseaseannotationsubject_index ON agmdiseaseannotation USING btree (diseaseannotationsubject_id);
CREATE INDEX agmdiseaseannotation_assertedallele_index ON agmdiseaseannotation USING btree (assertedallele_id);
CREATE INDEX agmdiseaseannotation_inferredallele_index ON agmdiseaseannotation USING btree (inferredallele_id);
CREATE INDEX agmdiseaseannotation_inferredgene_index ON agmdiseaseannotation USING btree (inferredgene_id);
ALTER TABLE allele ADD CONSTRAINT allele_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id);
ALTER TABLE allele_note ADD CONSTRAINT allele_note_allele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id);
CREATE INDEX allele_note_allele_index ON allele_note USING btree (allele_id);
ALTER TABLE allele_reference ADD CONSTRAINT allele_reference_allele_id_fk FOREIGN KEY (allele_id) REFERENCES allele (id);
ALTER TABLE allele_reference ADD CONSTRAINT allele_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id);
CREATE INDEX allele_reference_allele_index ON allele_reference USING btree (allele_id);
CREATE INDEX allele_reference_references_index ON allele_reference USING btree (references_id);
CREATE INDEX allele_reference_allele_references_index ON allele_reference USING btree (allele_id, references_id);
ALTER TABLE alleledatabasestatusslotannotation ADD CONSTRAINT alleledatabasestatus_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id);
CREATE INDEX alleledatabasestatus_singleallele_index ON alleledatabasestatusslotannotation USING btree (singleallele_id);
ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannoation_diseaseannotationsubject_id_fk FOREIGN KEY (diseaseannotationsubject_id) REFERENCES allele (id);
ALTER TABLE allelediseaseannotation ADD CONSTRAINT allelediseaseannotation_inferredgene_id_fk FOREIGN KEY (inferredgene_id) REFERENCES gene (id);
CREATE INDEX allelediseaseannotation_inferredgene_index ON allelediseaseannotation USING btree (inferredgene_id);
CREATE INDEX allelediseaseannotation_diseaseannotationsubject_index ON allelediseaseannotation USING btree (diseaseannotationsubject_id);
ALTER TABLE allelediseaseannotation_gene ADD CONSTRAINT allelediseaseannotation_gene_assertedgenes_id_fk FOREIGN KEY (assertedgenes_id) REFERENCES gene (id);
CREATE INDEX allelediseaseannotationgene_assertedgenes_index ON allelediseaseannotation_gene USING btree (assertedgenes_id);
CREATE INDEX allelefullname_singleallele_index ON allelefullnameslotannotation USING btree (singleallele_id);
ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctionalimpactslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id);
ALTER TABLE allelefunctionalimpactslotannotation ADD CONSTRAINT allelefunctionalimpactslotannotation_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES phenotypeterm (id);
CREATE INDEX allelefunctionalimpact_singleallele_index ON allelefunctionalimpactslotannotation USING btree (singleallele_id);
CREATE INDEX allelefunctionalimpact_phenotypeterm_index ON allelefunctionalimpactslotannotation USING btree (phenotypeterm_id);
ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_allelegeneassociationobject_id_fk FOREIGN KEY (allelegeneassociationobject_id) REFERENCES gene (id);
ALTER TABLE allelegeneassociation ADD CONSTRAINT allelegeneassociation_alleleassociationsubject_id_fk FOREIGN KEY (alleleassociationsubject_id) REFERENCES allele (id);
CREATE INDEX allelegeneassociation_allelegeneassociationobject_index ON allelegeneassociation USING btree (allelegeneassociationobject_id);
CREATE INDEX allelegeneassociation_alleleassociationsubject_index ON allelegeneassociation USING btree (alleleassociationsubject_id);
ALTER TABLE allelegenomicentityassociation ADD CONSTRAINT allelegenomicentityassociation_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES ecoterm (id);
ALTER TABLE allelegermlinetransmissionstatusslotannotation ADD CONSTRAINT allelegermlinetransmissionstatus_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id);
CREATE INDEX allelegermlinetransmissionstatus_singleallele_index ON allelegermlinetransmissionstatusslotannotation USING btree (singleallele_id);
ALTER TABLE alleleinheritancemodeslotannotation ADD CONSTRAINT alleleinheritancemode_phenotypeterm_id_fk FOREIGN KEY (phenotypeterm_id) REFERENCES phenotypeterm (id);
ALTER TABLE alleleinheritancemodeslotannotation ADD CONSTRAINT alleleinheritancemode_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id);
CREATE INDEX alleleinheritancemode_phenotypeterm_index ON alleleinheritancemodeslotannotation USING btree (phenotypeterm_id);
CREATE INDEX alleleinheritancemode_singleallele_index ON alleleinheritancemodeslotannotation USING btree (singleallele_id);
ALTER TABLE allelemutationtypeslotannotation ADD CONSTRAINT allelemutationtype_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id);
CREATE INDEX allelemutationtype_singleallele_index ON allelemutationtypeslotannotation USING btree (singleallele_id);
ALTER TABLE allelemutationtypeslotannotation_soterm ADD CONSTRAINT allelemutationtypesa_soterm_mutationtypes_id_fk FOREIGN KEY (mutationtypes_id) REFERENCES soterm (id);
CREATE INDEX allelemutationtypesa_soterm_mutationtypes_index ON allelemutationtypeslotannotation_soterm USING btree (mutationtypes_id);
ALTER TABLE allelenomenclatureeventslotannotation ADD CONSTRAINT allelenomenclatureeventslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id);
CREATE INDEX allelenomenclatureevent_singleallele_index ON allelenomenclatureeventslotannotation USING btree (singleallele_id);
ALTER TABLE allelesecondaryidslotannotation ADD CONSTRAINT allelesecondaryidslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id);
CREATE INDEX allelesecondaryid_singleallele_index ON allelesecondaryidslotannotation USING btree (singleallele_id);
ALTER TABLE allelesymbolslotannotation ADD CONSTRAINT allelesymbolslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id);
CREATE INDEX allelesymbol_singleallele_index ON allelesymbolslotannotation USING btree (singleallele_id);
ALTER TABLE allelesynonymslotannotation ADD CONSTRAINT allelesynonymslotannotation_singleallele_id_fk FOREIGN KEY (singleallele_id) REFERENCES allele (id);
CREATE INDEX allelesynonym_singleallele_index ON allelesynonymslotannotation USING btree (singleallele_id);
ALTER TABLE anatomicalterm ADD CONSTRAINT anatomicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE apoterm ADD CONSTRAINT apoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id);
ALTER TABLE atpterm ADD CONSTRAINT atpterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE biologicalentity ADD CONSTRAINT biologicalentity_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id);
CREATE INDEX biologicalentity_taxon_index ON biologicalentity USING btree (taxon_id);
ALTER TABLE bspoterm ADD CONSTRAINT bspoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE chebiterm ADD CONSTRAINT chebiterm_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id);
ALTER TABLE chemicalterm ADD CONSTRAINT chemicalterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE clterm ADD CONSTRAINT clterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id);
ALTER TABLE cmoterm ADD CONSTRAINT cmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE conditionrelation ADD CONSTRAINT conditionrelation_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id);
ALTER TABLE construct_reference ADD CONSTRAINT construct_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id);
CREATE INDEX construct_reference_references_index ON construct_reference USING btree (references_id);
ALTER TABLE constructcomponentslotannotation ADD CONSTRAINT constructcomponentslotannotation_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id);
CREATE INDEX constructcomponentslotannotation_taxon_index ON constructcomponentslotannotation USING btree (taxon_id);
ALTER TABLE constructgenomicentityassociation ADD CONSTRAINT constructgenomicentityassociation_cgeassociationobject_id_fk FOREIGN KEY (constructgenomicentityassociationobject_id) REFERENCES genomicentity (id);
CREATE INDEX constructgenomicentityassociation_object_index ON constructgenomicentityassociation USING btree (constructgenomicentityassociationobject_id);
ALTER TABLE daoterm ADD CONSTRAINT daoterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id);
ALTER TABLE diseaseannotation ADD CONSTRAINT diseaseannotation_diseaseannotationobject_id_fk FOREIGN KEY (diseaseannotationobject_id) REFERENCES doterm (id);
CREATE INDEX diseaseannotation_diseaseannotationobject_index ON diseaseannotation USING btree (diseaseannotationobject_id);
ALTER TABLE diseaseannotation_biologicalentity ADD CONSTRAINT diseaseannotation_biologicalentity_dgm_id_fk FOREIGN KEY (diseasegeneticmodifiers_id) REFERENCES biologicalentity (id);
CREATE INDEX diseaseannotation_biologicalentity_dgms_index ON diseaseannotation_biologicalentity USING btree (diseasegeneticmodifiers_id);
ALTER TABLE diseaseannotation_ecoterm ADD CONSTRAINT diseaseannotation_ecoterm_evidencecodes_id_fk FOREIGN KEY (evidencecodes_id) REFERENCES ecoterm (id);
CREATE INDEX diseaseannotation_ecoterm_evidencecodes_index ON diseaseannotation_ecoterm USING btree (evidencecodes_id);
ALTER TABLE diseaseannotation_gene ADD CONSTRAINT diseaseannotation_gene_with_id_fk FOREIGN KEY (with_id) REFERENCES gene (id);
CREATE INDEX diseaseannotation_gene_with_index ON diseaseannotation_gene USING btree (with_id);
ALTER TABLE doterm ADD CONSTRAINT doterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE dpoterm ADD CONSTRAINT dpoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id);
ALTER TABLE ecoterm ADD CONSTRAINT ecoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE emapaterm ADD CONSTRAINT emapaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id);
ALTER TABLE evidenceassociation_informationcontententity ADD CONSTRAINT evidenceassociation_infocontent_evidence_id_fk FOREIGN KEY (evidence_id) REFERENCES informationcontententity (id);
CREATE INDEX evidenceassociation_infocontent_evidence_index ON evidenceassociation_informationcontententity USING btree (evidence_id);
ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionchemical_id_fk FOREIGN KEY (conditionchemical_id) REFERENCES chemicalterm (id);
ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionid_id_fk FOREIGN KEY (conditionid_id) REFERENCES experimentalconditionontologyterm (id);
ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditiontaxon_id_fk FOREIGN KEY (conditiontaxon_id) REFERENCES ncbitaxonterm (id);
ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditiongeneontology_id_fk FOREIGN KEY (conditiongeneontology_id) REFERENCES goterm (id);
ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionclass_id_fk FOREIGN KEY (conditionclass_id) REFERENCES zecoterm (id);
ALTER TABLE experimentalcondition ADD CONSTRAINT experimentalcondition_conditionanatomy_id_fk FOREIGN KEY (conditionanatomy_id) REFERENCES anatomicalterm (id);
ALTER TABLE experimentalconditionontologyterm ADD CONSTRAINT experimentalconditionontologyterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE fbdvterm ADD CONSTRAINT fbdvterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id);
ALTER TABLE gene ADD CONSTRAINT gene_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id);
ALTER TABLE gene ADD CONSTRAINT gene_genetype_id_fk FOREIGN KEY (genetype_id) REFERENCES soterm (id);
CREATE INDEX gene_genetype_index ON gene USING btree (genetype_id);
ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_diseaseannotationsubject_id_fk FOREIGN KEY (diseaseannotationsubject_id) REFERENCES gene (id);
ALTER TABLE genediseaseannotation ADD CONSTRAINT genediseaseannotation_sgdstrainbackground_id_fk FOREIGN KEY (sgdstrainbackground_id) REFERENCES affectedgenomicmodel (id);
CREATE INDEX genediseaseannotation_diseaseannotationsubject_index ON genediseaseannotation USING btree (diseaseannotationsubject_id);
ALTER TABLE genefullnameslotannotation ADD CONSTRAINT genefullnameslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id);
CREATE INDEX genefullname_singlegene_index ON genefullnameslotannotation USING btree (singlegene_id);
ALTER TABLE genesecondaryidslotannotation ADD CONSTRAINT genesecondaryidslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id);
CREATE INDEX genesecondaryid_singlegene_index ON genesecondaryidslotannotation USING btree (singlegene_id);
ALTER TABLE genesymbolslotannotation ADD CONSTRAINT genesymbolslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id);
CREATE INDEX genesymbol_singlegene_index ON genesymbolslotannotation USING btree (singlegene_id);
ALTER TABLE genesynonymslotannotation ADD CONSTRAINT genesynonymslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id);
CREATE INDEX genesynonym_singlegene_index ON genesynonymslotannotation USING btree (singlegene_id);
ALTER TABLE genesystematicnameslotannotation ADD CONSTRAINT genesystematicnameslotannotation_singlegene_id_fk FOREIGN KEY (singlegene_id) REFERENCES gene (id);
CREATE INDEX genesystematicname_singlegene_index ON genesystematicnameslotannotation USING btree (singlegene_id);
ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_objectgene_id_fk FOREIGN KEY (objectgene_id) REFERENCES gene (id);
ALTER TABLE genetogeneorthology ADD CONSTRAINT genetogeneorthology_subjectgene_id_fk FOREIGN KEY (subjectgene_id) REFERENCES gene (id);
CREATE INDEX genetogeneorthology_objectgene_index ON genetogeneorthology USING btree (objectgene_id);
CREATE INDEX genetogeneorthology_subjectgene_index ON genetogeneorthology USING btree (subjectgene_id);
ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated_evidencecode_id_fk FOREIGN KEY (evidencecode_id) REFERENCES ecoterm (id);
ALTER TABLE genetogeneorthologycurated ADD CONSTRAINT genetogeneorthologycurated_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id);
CREATE INDEX genetogeneorthologycurated_evidencecode_index ON genetogeneorthologycurated USING btree (evidencecode_id);
CREATE INDEX genetogeneorthologycurated_singlereference_index ON genetogeneorthologycurated USING btree (singlereference_id);
ALTER TABLE genomicentity ADD CONSTRAINT genomicentity_id_fk FOREIGN KEY (id) REFERENCES biologicalentity (id);
ALTER TABLE genomicentity_crossreference ADD CONSTRAINT genomicentitycrossreference_genomicentity_id_fk FOREIGN KEY (genomicentity_id) REFERENCES genomicentity (id);
CREATE INDEX genomicentity_crossreference_ge_xref_index ON genomicentity_crossreference USING btree (genomicentity_id, crossreferences_id);
CREATE INDEX genomicentity_crossreference_genomicentity_index ON genomicentity_crossreference USING btree (genomicentity_id);
ALTER TABLE goterm ADD CONSTRAINT goterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE hpterm ADD CONSTRAINT hpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id);
ALTER TABLE materm ADD CONSTRAINT materm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id);
ALTER TABLE miterm ADD CONSTRAINT miterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE mmoterm ADD CONSTRAINT mmoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE mmusdvterm ADD CONSTRAINT mmusdvterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id);
ALTER TABLE modterm ADD CONSTRAINT modterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE molecule ADD CONSTRAINT molecule_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id);
ALTER TABLE mpathterm ADD CONSTRAINT mpathterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE mpterm ADD CONSTRAINT mpterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id);
ALTER TABLE ncbitaxonterm ADD CONSTRAINT ncbitaxonterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE note_reference ADD CONSTRAINT note_reference_references_id_fk FOREIGN KEY (references_id) REFERENCES reference (id);
CREATE INDEX note_reference_references_index ON note_reference USING btree (references_id);
ALTER TABLE obiterm ADD CONSTRAINT obiterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE ontologyterm_crossreference ADD CONSTRAINT ontologyterm_crossreference_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id);
CREATE INDEX ontologyterm_crossreference_ontologyterm_index ON ontologyterm_crossreference USING btree (ontologyterm_id);
ALTER TABLE ontologyterm_definitionurls ADD CONSTRAINT ontologyterm_definitionurls_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id);
CREATE INDEX ontologyterm_definitionurls_ontologyterm_index ON ontologyterm_definitionurls USING btree (ontologyterm_id);
ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_isaancestors_id_fk FOREIGN KEY (isaancestors_id) REFERENCES ontologyterm(id);
ALTER TABLE ontologyterm_isa_ancestor_descendant ADD CONSTRAINT ontologyterm_isa_ancestor_descendant_isadescendants_id_fk FOREIGN KEY (isadescendants_id) REFERENCES ontologyterm(id);
CREATE INDEX ontologyterm_isa_ancestor_descendant_isaancestors_index ON ontologyterm_isa_ancestor_descendant USING btree (isaancestors_id);
CREATE INDEX ontologyterm_isa_ancestor_descendant_isadescendants_index ON ontologyterm_isa_ancestor_descendant USING btree (isadescendants_id);
ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_isachildren_id_fk FOREIGN KEY (isachildren_id) REFERENCES ontologyterm (id);
ALTER TABLE ontologyterm_isa_parent_children ADD CONSTRAINT ontologyterm_isa_parent_children_isaparents_id_fk FOREIGN KEY (isaparents_id) REFERENCES ontologyterm (id);
CREATE INDEX ontologyterm_isa_parent_children_isachildren_index ON ontologyterm_isa_parent_children USING btree (isachildren_id);
CREATE INDEX ontologyterm_isa_parent_children_isaparents_index ON ontologyterm_isa_parent_children USING btree (isaparents_id);
ALTER TABLE ontologyterm_secondaryidentifiers ADD CONSTRAINT ontologyterm_secondaryidentifiers_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id);
CREATE INDEX ontologyterm_secondaryidentifiers_ontologyterm_index ON ontologyterm_secondaryidentifiers USING btree (ontologyterm_id);
ALTER TABLE ontologyterm_subsets ADD CONSTRAINT ontologyterm_subsets_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id);
CREATE INDEX ontologyterm_subsets_ontologyterm_index ON ontologyterm_subsets USING btree (ontologyterm_id);
ALTER TABLE ontologyterm_synonym ADD CONSTRAINT ontologyterm_synonym_ontologyterm_id_fk FOREIGN KEY (ontologyterm_id) REFERENCES ontologyterm (id);
CREATE INDEX ontologyterm_synonym_ontologyterm_index ON ontologyterm_synonym USING btree (ontologyterm_id);
ALTER TABLE patoterm ADD CONSTRAINT patoterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE phenotypeterm ADD CONSTRAINT phenotypeterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE pwterm ADD CONSTRAINT pwterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE reference ADD CONSTRAINT reference_id_fk FOREIGN KEY (id) REFERENCES informationcontententity (id);
ALTER TABLE reference_crossreference ADD CONSTRAINT reference_crossreference_reference_id_fk FOREIGN KEY (reference_id) REFERENCES reference (id);
CREATE INDEX reference_crossreference_reference_index ON reference_crossreference USING btree (reference_id);
ALTER TABLE roterm ADD CONSTRAINT roterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE rsterm ADD CONSTRAINT rsterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE singlereferenceassociation ADD CONSTRAINT singlereferenceassociation_singlereference_id_fk FOREIGN KEY (singlereference_id) REFERENCES reference (id);
CREATE INDEX singlereferenceassociation_singlereference_index ON singlereferenceassociation USING btree (singlereference_id);
ALTER TABLE slotannotation_informationcontententity ADD CONSTRAINT slotannotation_informationcontententity_evidence_id_fk FOREIGN KEY (evidence_id) REFERENCES informationcontententity (id);
CREATE INDEX slotannotation_informationcontententity_evidence_index ON slotannotation_informationcontententity USING btree (evidence_id);
ALTER TABLE soterm ADD CONSTRAINT soterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE species ADD CONSTRAINT species_taxon_id_fk FOREIGN KEY (taxon_id) REFERENCES ncbitaxonterm (id);
ALTER TABLE stageterm ADD CONSTRAINT stageterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE uberonterm ADD CONSTRAINT uberonterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id);
ALTER TABLE variant ADD CONSTRAINT variant_id_fk FOREIGN KEY (id) REFERENCES genomicentity (id);
ALTER TABLE variant ADD CONSTRAINT variant_sourcegeneralconsequence_id_fk FOREIGN KEY (sourcegeneralconsequence_id) REFERENCES soterm (id);
ALTER TABLE variant ADD CONSTRAINT variant_varianttype_id_fk FOREIGN KEY (varianttype_id) REFERENCES soterm (id);
CREATE INDEX variant_sourcegeneralconsequence_index ON variant USING btree (sourcegeneralconsequence_id);
CREATE INDEX variant_varianttype_index ON variant USING btree (varianttype_id);
ALTER TABLE variant_note ADD CONSTRAINT variant_note_variant_id_fk FOREIGN KEY (variant_id) REFERENCES variant (id);
CREATE INDEX variant_note_variant_index ON variant_note USING btree (variant_id);
ALTER TABLE vtterm ADD CONSTRAINT vtterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE wbbtterm ADD CONSTRAINT wbbtterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id);
ALTER TABLE wblsterm ADD CONSTRAINT wblsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id);
ALTER TABLE wbphenotypeterm ADD CONSTRAINT wbphenotypeterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id);
ALTER TABLE xbaterm ADD CONSTRAINT xbaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id);
ALTER TABLE xbedterm ADD CONSTRAINT xbedterm_id_fk FOREIGN KEY (id) REFERENCES ontologyterm (id);
ALTER TABLE xbsterm ADD CONSTRAINT xbsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id);
ALTER TABLE xcoterm ADD CONSTRAINT xcoterm_id_fk FOREIGN KEY (id) REFERENCES experimentalconditionontologyterm (id);
ALTER TABLE xpoterm ADD CONSTRAINT xpoterm_id_fk FOREIGN KEY (id) REFERENCES phenotypeterm (id);
ALTER TABLE xsmoterm ADD CONSTRAINT xsmoterm_id_fk FOREIGN KEY (id) REFERENCES chemicalterm (id);
ALTER TABLE zecoterm ADD CONSTRAINT zecoterm_id_fk FOREIGN KEY (id) REFERENCES experimentalconditionontologyterm (id);
ALTER TABLE zfaterm ADD CONSTRAINT zfaterm_id_fk FOREIGN KEY (id) REFERENCES anatomicalterm (id);
ALTER TABLE zfsterm ADD CONSTRAINT zfsterm_id_fk FOREIGN KEY (id) REFERENCES stageterm (id);
ALTER SEQUENCE biologicalentity_seq INCREMENT BY 50;
ALTER SEQUENCE informationcontententity_seq INCREMENT BY 50;
ALTER SEQUENCE ontologyterm_seq INCREMENT BY 50;