Unused target still in use

I’m trying to clean-up an old target which isn’t referenced by any report or task, nothing in trashcan either, but it is still marked as “in-use”.

So I went to psql, and tried to DELETE the row, resulting in a FK constraint violation from targets_login_data.

The SSH credentials of that target cannot be edited, since it is marked in-use, so I cannot resolve this with GSA (I’m running the latest community containers)

DELETE target_login_data WHERE target=3;
DELETE target WHERE id=3;
finally did the job, but invading the DB doesn’t feel quite right…

NB: The database was initialized two years ago with 22.4, maybe the FK is ON DELETE CASCADE now instead of ON DELETE RESTRICT?

There’s another un-deletable target lurking around, so if you can give me an official way to clean-up, please advise.

Regards, Andreas