nuxsmin / sysPass

Systems Password Manager
https://syspass.org
GNU General Public License v3.0
975 stars 208 forks source link

Can't delete empty category #965

Closed LeDistordu closed 6 years ago

LeDistordu commented 6 years ago

Hello,

Can't delete empty category i have error :

"Error while deleting the category"

nuxsmin commented 6 years ago

Hello, which sysPass version are you running?. What did you mean by "empty"?

Regards

LeDistordu commented 6 years ago

2.1.15

At first I thought that a category could not be erased because it contained something. Currently I am trying to delete a category that contains no password.

nuxsmin commented 6 years ago

It could be so because the category is in use by the accounts' history. I know that this could be a hassle, but items data need to be consistent so they need to keep the relations over the time, so in this way you can fully recover the item's data whenever you need.

Regards

LeDistordu commented 6 years ago

Account history ? How do I concretely remove a category that has this problem ?

Thank you for your help

nuxsmin commented 6 years ago

Unfortunately there is no "easy" way to do it, since the UI does not show the categories used by an account's history record.

The hard way is by issuing an SQL command on the DB:

delete from accHistory where acchistory_categoryId = (SELECT category_id FROM categories WHERE category_name = "SET_CATEGORY_NAME")

It will be improved in next version.

Please, always perform a backup before working on the database