atom icon indicating copy to clipboard operation
atom copied to clipboard

Feature: Command line tool for purging taxonomy

Open mcantelon opened this issue 2 years ago • 2 comments

Occasionally there's a need to purge taxonomies during migration testing, etc. A "taxonomy:purge" task would save time (given the alternative is writing a script to do it).

mcantelon avatar Jun 25 '23 06:06 mcantelon

Useful idea! Some thoughts:

  • Some taxonomies should definitely be locked from this task, i.e. hidden ones like publication status; possibly others
  • Some, if you allow them to be deleted at all, should probably require a --force option, since they could dramatically affect other related records. For example, deleting the container types from one of the physical storage taxonomies - if done in error, that would be reaaaaaaallly annoying to fix later! Similarly, many taxonomies are tied to controlled values taken directly from standards. At minimum there should be a BIG RED WARNING and y/n to continue for most cases
  • It would be really helpful to have some sort of option to either preserve or re-populate any default terms from the fixtures. Possibly both! I say both because:
    • We already have a problem with fixture terms and translations in upgraded users - they just never get the translations. Deleting all terms and then repopulating would solve that issue! However...
    • Deleting all terms and then repopulating means deleting all existing relations. So some option to delete everything EXCEPT AtoM's default terms for a given taxonomy (or delete/replace but keep relations) could help users clean up a bunch of local custom terms they don't want without potentially wiping AtoM's defaults

fiver-watson avatar Jun 28 '23 15:06 fiver-watson

Thanks @fiver-watson... good ideas! The preserve functionality definitely makes sense... I'll look into adding that. I've currently got it so it won't purge "locked" taxonomies but the option to do this, confirming with --force or manual confirmation, would be good to have if I add the preserve functionality.

mcantelon avatar Jun 29 '23 07:06 mcantelon