Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a contact_dbxref table #122

Open
Ferrisx4 opened this issue Jan 20, 2022 · 7 comments
Open

Add a contact_dbxref table #122

Ferrisx4 opened this issue Jan 20, 2022 · 7 comments
Labels
Ready for PR These issues have enough discussion that we can move forward with a PR small change

Comments

@Ferrisx4
Copy link

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

@scottcain
Copy link
Member

This feels like a fairly straight forward addition and would be a small change I believe

@laceysanderson
Copy link
Contributor

I support this change :-) @Ferrisx4 would you like to make a PR for it?

@Ferrisx4
Copy link
Author

Ferrisx4 commented Mar 7, 2022

Sure thing @laceysanderson

@laceysanderson laceysanderson added the Ready for PR These issues have enough discussion that we can move forward with a PR label Mar 7, 2022
@Ferrisx4
Copy link
Author

Ferrisx4 commented Mar 7, 2022

Hi all, a few questions as it is my first attempt at contributing to Chado -

  1. Would this change be for 1.4x?
  2. After reading the docs and looking at previous PRs for adding tables, I will be adding a file into the migrations/ directory in the 1.4 branch, correct? There's also chado/migrations.
    As for the name, would it be something like V1.4.???.010__add_contact_dbxref_table.sql?.

@spficklin
Copy link
Contributor

Hey @Ferrisx4 so you have been confused by what I just described in issue #130 . I think it needs some clarification. But it's my understanding for now, that you would use something like V1.3.3.011_add_contact_dbxref_table.sql. Valentin used the _010 suffix in the version for his PR #108 . And you want to do a pull request to the 1.4 branch.

@Ferrisx4
Copy link
Author

Ferrisx4 commented Mar 7, 2022

Oh wow, what timing, I hadn't seen #130! Thanks!

@spficklin
Copy link
Contributor

spficklin commented Mar 7, 2022

Oh, and it seems @laceysanderson just used the _011 suffix in PR #118 so you'll want to go with _012.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for PR These issues have enough discussion that we can move forward with a PR small change
Projects
None yet
Development

No branches or pull requests

4 participants