Adds delete-orphan to database deletion.

Change-Id: I3570c812c042365e68eef3b5463899afa85eb9fd
Fixes: bug #1096549
Merge "Adds delete-orphan to database deletion."