You could turn the reference to Document into a onetoone instead of foreignkey, and that way you would have the option to set the cascadeDelete parameter to true.
If you are not allowed to alter the data model and drop the database you would need to create an upgrade trigger.