Open laceysanderson opened 7 years ago
Question: When inserting a row to projectprop, I've use cvterm genus, and together with project id and the organism value make up a record. In uninstall hook, when deleting any module related records, I've used the project id and the genus cvterm_id to delete. However, I feel like I might inadvertently delete rows used by other module that uses genus cvterm and same project id.
Would it be safer if I create a cv term rawphenotypes_genus in the same way as rawphenotypes_measurements for traits? this way I can be sure to safely delete only the rows with this cvterm.
Please advice.
The approach you've taken for inserting the project property is perfect. Just don't delete this information on module uninstall. Even without raw phenotypes, the project validly contains data related to that organism. Thus there is no need to remove that information.
On a more general note, modules should never delete information from Chado on uninstall. This is a Tripal rule and ensures that the data in Chado which can be being used by systems other then Tripal is always left intact.
We need to check that when the stock_id for a given row is looked up, we restrict the query to the organism. Currently, if you try to load data for any of the breeding program crosses, the system returns validation telling you they are not unique when in fact they are -by organism.
Each phenotyping project should only collect data for a single organism. Therefore, we can solve this bug by saving the organism for a project in the projectprop table and then looking it up when validating or loading a raw phenotype dataset. We should add form elements to the admin manage projects interface to allow setting of the organism.