-
Notifications
You must be signed in to change notification settings - Fork 51
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
2328 db #2333
2328 db #2333
Conversation
INSERT INTO tab_active_transport_types VALUES('BiDirectional'); | ||
INSERT INTO tab_active_transport_types VALUES('Efflux'); | ||
INSERT INTO tab_active_transport_types VALUES('Influx'); | ||
INSERT INTO tab_active_transport_types VALUES('PgpLike'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the new table tab_active_transport_types with the 4 currently available active transport types.
So actually it's just a subset of tab_process_types
CREATE TABLE [tab_known_transporters]( | ||
[gene] text REFERENCES [tab_protein_names]([protein]) ON UPDATE CASCADE, | ||
[species] text REFERENCES [tab_species]([species]) ON UPDATE CASCADE, | ||
[transport_type] text REFERENCES [tab_active_transport_types]([transport_type]) ON UPDATE CASCADE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added FKs for gene and transport_type
[membrane] text, | ||
CONSTRAINT [tab_known_transporters_containers_pk] PRIMARY KEY([gene], [species], [container_type], [container_name]), | ||
CONSTRAINT [tab_known_transporters_containers_tab_known_transporters_gene_species_fk] FOREIGN KEY([gene], [species]) REFERENCES [tab_known_transporters]([gene], [species]) ON UPDATE CASCADE, | ||
FOREIGN KEY([container_type], [container_name]) REFERENCES [tab_container_names]([container_type], [container_name]) ON UPDATE CASCADE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added FK for container_type+container_name
CONSTRAINT [tab_known_transporters_containers_pk] PRIMARY KEY([gene], [species], [container_type], [container_name]), | ||
CONSTRAINT [tab_known_transporters_containers_tab_known_transporters_gene_species_fk] FOREIGN KEY([gene], [species]) REFERENCES [tab_known_transporters]([gene], [species]) ON UPDATE CASCADE, | ||
FOREIGN KEY([container_type], [container_name]) REFERENCES [tab_container_names]([container_type], [container_name]) ON UPDATE CASCADE, | ||
CHECK(membrane IN ('Apical', 'Basolateral', 'BloodBrainBarrier', 'Tissue'))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added membrane as constraint.
Was thinking about defining another new table (membrane_types or so) - but currently this is the only place where the membrane is used, so I kept is as check constraint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep/ Not use anywhere else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, if we agree to remove BloodBrainBarrier and TIssue and use Apical and Basolateral, then we can only keep the two entries here
[transport_direction] text CONSTRAINT [tab_transport_directions_pk] PRIMARY KEY, | ||
[display_name] text NOT NULL, | ||
[description] text NOT NULL, | ||
[icon] text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the weird default value from the icon column
CONSTRAINT [tab_known_transporters_containers_pk] PRIMARY KEY([gene], [species], [container_type], [container_name]), | ||
CONSTRAINT [tab_known_transporters_containers_tab_known_transporters_gene_species_fk] FOREIGN KEY([gene], [species]) REFERENCES [tab_known_transporters]([gene], [species]) ON UPDATE CASCADE, | ||
FOREIGN KEY([container_type], [container_name]) REFERENCES [tab_container_names]([container_type], [container_name]) ON UPDATE CASCADE, | ||
CHECK(membrane IN ('Apical', 'Basolateral', 'BloodBrainBarrier', 'Tissue'))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep/ Not use anywhere else
CONSTRAINT [tab_known_transporters_containers_pk] PRIMARY KEY([gene], [species], [container_type], [container_name]), | ||
CONSTRAINT [tab_known_transporters_containers_tab_known_transporters_gene_species_fk] FOREIGN KEY([gene], [species]) REFERENCES [tab_known_transporters]([gene], [species]) ON UPDATE CASCADE, | ||
FOREIGN KEY([container_type], [container_name]) REFERENCES [tab_container_names]([container_type], [container_name]) ON UPDATE CASCADE, | ||
CHECK(membrane IN ('Apical', 'Basolateral', 'BloodBrainBarrier', 'Tissue'))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, if we agree to remove BloodBrainBarrier and TIssue and use Apical and Basolateral, then we can only keep the two entries here
OK, |
We use apical or basolateral (tissue means one or the other, I added it as comment in the code). Since it's only used in a switch statement...I just need to change it and done |
Where is it? |
ok, merging for now. |
No description provided.