From 500e66ab937a9755153a4bee224786b17968595f Mon Sep 17 00:00:00 2001 From: Ferrisx4 Date: Tue, 8 Mar 2022 15:52:46 -0500 Subject: [PATCH 1/2] Add contact_dbxref table SQL to migrations --- .../V1.3.3.012_add_contact_dbxref_table.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 chado/migrations/V1.3.3.012_add_contact_dbxref_table.sql diff --git a/chado/migrations/V1.3.3.012_add_contact_dbxref_table.sql b/chado/migrations/V1.3.3.012_add_contact_dbxref_table.sql new file mode 100644 index 00000000..a759f9bb --- /dev/null +++ b/chado/migrations/V1.3.3.012_add_contact_dbxref_table.sql @@ -0,0 +1,15 @@ +CREATE TABLE contact_dbxref ( + contact_dbxref_id BIGSERIAL NOT NULL, + contact_id BIGINT NOT NULL, + dbxref_id BIGINT NOT NULL, + is_current INT NOT NULL, + PRIMARY KEY (contact_dbxref_id), + FOREIGN KEY (dbxref_id) REFERENCES dbxref (dbxref_id) ON DELETE CASCADE INITIALLY DEFERRED, + CONSTRAINT "contact_dbxref_contact_id_fkey" FOREIGN KEY (contact_id) REFERENCES contact (contact_id) ON DELETE CASCADE INITIALLY DEFERRED, +); + +create index contact_dbxref_idx1 on contact_dbxref (contact_id); +create index contact_dbxref_idx2 on contact_dbxref (dbxref_id); + +COMMENT ON TABLE "chado"."contact_dbxref" IS 'A contact_dbxref is a dbxref associated with a contact. +A contact can have many dbxrefs associated with it, and a dbxref can be associated with many contacts.'; \ No newline at end of file From 7e3b03b5ef23065b1bfcbcfeecb05dfc1b668e1d Mon Sep 17 00:00:00 2001 From: Ferrisx4 Date: Tue, 8 Mar 2022 15:55:33 -0500 Subject: [PATCH 2/2] Syntax fixes (remove quotation marks) --- chado/migrations/V1.3.3.012_add_contact_dbxref_table.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chado/migrations/V1.3.3.012_add_contact_dbxref_table.sql b/chado/migrations/V1.3.3.012_add_contact_dbxref_table.sql index a759f9bb..0b94bc84 100644 --- a/chado/migrations/V1.3.3.012_add_contact_dbxref_table.sql +++ b/chado/migrations/V1.3.3.012_add_contact_dbxref_table.sql @@ -5,11 +5,11 @@ CREATE TABLE contact_dbxref ( is_current INT NOT NULL, PRIMARY KEY (contact_dbxref_id), FOREIGN KEY (dbxref_id) REFERENCES dbxref (dbxref_id) ON DELETE CASCADE INITIALLY DEFERRED, - CONSTRAINT "contact_dbxref_contact_id_fkey" FOREIGN KEY (contact_id) REFERENCES contact (contact_id) ON DELETE CASCADE INITIALLY DEFERRED, + CONSTRAINT contact_dbxref_contact_id_fkey FOREIGN KEY (contact_id) REFERENCES contact (contact_id) ON DELETE CASCADE INITIALLY DEFERRED, ); create index contact_dbxref_idx1 on contact_dbxref (contact_id); create index contact_dbxref_idx2 on contact_dbxref (dbxref_id); -COMMENT ON TABLE "chado"."contact_dbxref" IS 'A contact_dbxref is a dbxref associated with a contact. -A contact can have many dbxrefs associated with it, and a dbxref can be associated with many contacts.'; \ No newline at end of file +COMMENT ON TABLE contact_dbxref IS 'A contact_dbxref is a dbxref associated with a contact. +A contact can have many dbxrefs associated with it, and a dbxref can be associated with many contacts.' \ No newline at end of file