Merge branch '6304-del-database' into 'develop'

Also cleanup databases when a client is deleted, fixes #6304

Closes #6304

See merge request !1596
1 job for develop in 8 seconds (queued for 4 seconds)