When using Batch Edit in Specify 6, a Workbench Dataset is created that does not get automatically deleted after the changes are committed. It also seems there is no way to delete it from within Specify.
Is this intentional behavior? Does anyone know if deleting these datasets directly from the database would introduce any issues?
Any guidance is appreciated!
[!info]+ Background
Tech Specs
Specify 6.8.03
MySQL 5.7.39I am working on removing database “bloat” by exporting workbench datasets left behind by former collections managers and assistants. Some of these may still be helpful in fixing several database errors, so I do not want to bulk-delete everything.
The problem is that the Workbench (WB) datasets are scattered across so many users, and I have no clue who has what. Rather than logging in as each user (which would involve resetting passwords and granting WB access), I used the following SQL query to get a count of datasets per user.
SELECT COUNT(wb.Name) AS DatasetCount ,su.Name FROM workbench wb JOIN specifyuser su ON wb.SpecifyUserID = su.SpecifyUserID GROUP BY wb.SpecifyUserID ORDER BY DatasetCount DESC;
To my surprise, my own user account had 85 datasets
… but I know I should only have 2.
To get some clues for the mystery sets, I ran this query:
SELECT wb.Name ,wb.SrcFilePath ,su.Name FROM workbench wb JOIN specifyuser su ON wb.SpecifyUserID = su.SpecifyUserID WHERE su.Name = 'emd0083'; --THIS IS MY USERNAME
It turns out many of the “mystery” datasets were named after queries I regularly use for batch editing. This leads me to believe that every time I use Batch Edit, it leaves behind a WB dataset that cannot be seen or deleted from within Specify 6.
Luckily, all of these datasets from batch edits have
--
in their name so they can be easily found by inserting this into the query.WHERE Name LIKE '%--%'
I have tested deleting a single dataset directly from the database using a series of
DELETE
statements (i.e., delete fromworkbenchdataitem
,workbenchrow
,workbench
,workbenchtemplatemappingitem
, andworkbenchtemplate
). This seems to work fine, but I’m not positive it isn’t breaking anything.