Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions chado/migrations/V1.3.3.012_add_contact_dbxref_table.sql
Original file line number Diff line number Diff line change
@@ -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 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.'