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

database integrity: feature-designed analysis needs to be taken into account. #32

Open
bradfordcondon opened this issue May 4, 2018 · 1 comment

Comments

@bradfordcondon
Copy link
Contributor

@laceysanderson said in GMOD/Chado#59

I would worry a bit about this causing inconsistencies in the database. For example, what if your transcripts for a given analysis are for species X and the linker table points to species Y? I think this might be better implemented as a materialized view that pulls through the analysis -> feature -> organism connection. From an application standpoint this ends up being the same thing but from the database level it will help you keep consistency. Would that work for HWG ?

@bradfordcondon
Copy link
Contributor Author

Perhaps the trigger could check if the organism for the current feature being inserted is in the organism_analysis table and if not, adds it?

So 2 things need to happen.

  • Don't let the user disassociate an organism from an analysis if features exist that link it. This can be in
    the widget's validate.
  • Automatically add the association when new features are inserted. How about a hook entity_published (probably not called that) that checks if the entity type is a feature and associates as necessary?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant