Chado icon indicating copy to clipboard operation
Chado copied to clipboard

Add a contact_dbxref table

Open Ferrisx4 opened this issue 2 years ago • 7 comments

The proposed contact_dbxref table would be used to link contacts from contact to dbxref for the purpose of storing values such as the contact's ORCID or Google Scholar ID, or any other external database identifier.

A possible implementation of this, following other dbxref tables as a template:

-- Table Definition
CREATE TABLE "chado"."contact_dbxref" (
    "contact_dbxref_id" int8 NOT NULL DEFAULT nextval('chado.contact_dbxref_contact_dbxref_id_seq'::regclass),
    "contact_id" int8 NOT NULL,
    "dbxref_id" int8 NOT NULL,
    "is_current" int2 NOT NULL,
    CONSTRAINT "contact_dbxref_dbxref_id_fkey" FOREIGN KEY ("dbxref_id") REFERENCES "chado"."dbxref"("dbxref_id") ON DELETE CASCADE,
    CONSTRAINT "contact_dbxref_contact_id_fkey" FOREIGN KEY ("contact_id") REFERENCES "chado"."contact"("contact_id") ON DELETE CASCADE,
    PRIMARY KEY ("contact_dbxref_id")
);

This table was used in a custom plugin on a Tripal site. By utilizing dbxrefs, an individual contact can have multiple entries and their accessions will automatically be available to generate links to their profiles: Screen Shot 2022-01-20 at 2 02 38 PM

Ferrisx4 avatar Jan 20 '22 19:01 Ferrisx4