BioKIC / NEON-Biorepository

Development base for the NEON Biorepository Data Portal host by BioKIC - Arizona State University (https://biorepo.neonscience.org)
GNU General Public License v2.0
2 stars 1 forks source link

Remove non-NEON collections #536

Closed sunray1 closed 3 months ago

sunray1 commented 3 months ago

We've decided it's outside of the biorepository scope to manage non-NEON collections that were collected at NEON sites. These needs to be removed.

kyule commented 3 months ago

@sunray1 @egbot Sanity check please! I should remove all of the associated entries (ie. rows associated by collids or occids) from:

Not sure how to tackle fmchklsttaxalink other than to basically start over with all of the diversity (!=carabid, mosquito) checklists. :( They all have to be fixed/updated anyways once we have a workable "subsample" occurrences capability.

What should happen with the images table? Seems like keeping them linked to the tid is good...

Remove from omcollcategories for the purpose of the front end?

Is anything else relevant?

egbot commented 3 months ago

Associated records within fmvouchers, omcollcatlink, omoccuredits, and omoccurdeterminations tables will automatically be removed when you delete the records within omoccurrences, thus you can ignore these. However, this is not the case within the images table. You will have to delete any image links before the occurrence records. After deleting occurrences, you can then delete the omcollectionstats and omcollections records, in that order.

kyule commented 3 months ago

@egbot Is this even if the omoccurrences are deleted via the backend?

And for the images it is just deleting occid from the table when the occid is associated with those collections? It's ok to leave the rows with occid=NULL so that the images stay associated with the tids, right?

egbot commented 3 months ago

If you want to keep the specimen images linked to the taxon profile pages, you will need to null the occid value within the image table, thus breaking the link to omoccurrences table, which would allow those records to be removed. If field images linked to the taxon profile pages would be better, you could import field images from SEINet or iNaturalist, without creating occurrence records.

egbot commented 3 months ago

@egbot Is this even if the omoccurrences are deleted via the backend?

And for the images it is just deleting occid from the table when the occid is associated with those collections? It's ok to leave the rows with occid=NULL so that the images stay associated with the tids, right?

Yes, and yes to both questions.

kyule commented 3 months ago

@egbot Awesome, thank you, I'm on it!