This solves the problem of deleting implicitly child-items, which depend on each other when deleting an item. When deleting an item, the deletion of child-items in the content repository happens in an arbitrary order, which could raise fk constraints. Since the deletion happens in a transaction, the deferring checking of the constraints helps, since then the constraint violating item is also already deleted.
There is no update script necessary, since reload alters the constraint.
Drop "ON DELETE CASCADE" on page_template, since this might lead to crippled entries in the database.
When someone delets via operations in the database a form, protentially existing form pages refering to this item might be left in a crippled state. The cascade operation deletes the revision (xowiki_page_instance), but leaves the half-crippled item. The problem does not exist over the web interface, since it does not allow such items to be deleted while form pages exist.